Will numeric comparison, between a BigInt and a Number, coerce one argument to BigInt, or coerce one argument to Number?
For example, in the following, is 3n
coerced to 3
, or is 1
coerced to 1n
?
console.log(3n > 1) // true
Both operands appear to be converted to a "mathematical value" in 4.k of the IsLessThan
abstract operation; a process that is designated ℝ in the specification.
I have no idea what this means, however.
I note that:
console.log(19_999_999_999_999_998 > 19_999_999_999_999_999n) // true
Perhaps the "mathematical value", ℝ, of 19,999,999,999,999,998, is the descriptor for the value 20,000,000,000,000,000, which is the closest possible IEEE754 representation?
I still don't understand if coercion can be said to occur, given that a Number can have a fractional component, and a BigInt cannot.