mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser and offers an integrated solution to work with numbers, big numbers, complex numbers, units, and matrices.
20 lines (19 loc) • 459 B
JavaScript
module.exports = {
'name': 'compare',
'category': 'Operators',
'syntax': [
'compare(x, y)'
],
'description':
'Compare two values. Returns 1 if x is larger than y, -1 if x is smaller than y, and 0 if x and y are equal.',
'examples': [
'compare(2, 3)',
'compare(3, 2)',
'compare(2, 2)',
'compare(5cm, 40mm)',
'compare(2, [1, 2, 3])'
],
'seealso': [
'equal', 'unequal', 'smaller', 'smallereq', 'largereq'
]
};