mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
21 lines
609 B
JavaScript
21 lines
609 B
JavaScript
module.exports = {
|
|
'name': 'compareNatural',
|
|
'category': 'Relational',
|
|
'syntax': [
|
|
'compareNatural(x, y)'
|
|
],
|
|
'description':
|
|
'Compare two values in a natural way. For numeric values, returns 1 if x is larger than y, -1 if x is smaller than y, and 0 if x and y are equal. Strings and complex numbers are compared in a natural way.',
|
|
'examples': [
|
|
'compare(2, 3)',
|
|
'compare(3, 2)',
|
|
'compare(2, 2)',
|
|
'compare(5cm, 40mm)',
|
|
'compare("2", "10")',
|
|
'compare(2 + 3i, 2 + 4i)'
|
|
],
|
|
'seealso': [
|
|
'equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare'
|
|
]
|
|
};
|