mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif
15 lines • 432 B
JavaScript
import { isCollection } from '../../../utils/is.js';
import { dimToZeroBase, isNumberOrBigNumber } from './dimToZeroBase.js';
/**
* Change last argument dim from one-based to zero-based.
*/
export function lastDimToZeroBase(args) {
if (args.length === 2 && isCollection(args[0])) {
args = args.slice();
var dim = args[1];
if (isNumberOrBigNumber(dim)) {
args[1] = dimToZeroBase(dim);
}
}
return args;
}