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
21 lines (20 loc) • 471 B
JavaScript
module.exports = {
'name': 'compare',
'category': 'Relational',
'syntax': [
'compare(x, y)'
],
'description':
'Compare two values. ' +
'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',
'examples': [
'compare(2, 3)',
'compare(3, 2)',
'compare(2, 2)',
'compare(5cm, 40mm)',
'compare(2, [1, 2, 3])'
],
'seealso': [
'equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compareNatural', 'compareText'
]
}