tc39 / proposal-iterator.range

A proposal for ECMAScript to add a built-in Iterator.range()
https://tc39.es/proposal-iterator.range/
MIT License
487 stars 13 forks source link

math infinity -> number infinity #62

Closed bakkot closed 1 year ago

bakkot commented 1 year ago

These are Number values, not mathematical values.

Jack-Works commented 1 year ago

thank you! but can you explain what's the difference of these two values?

bakkot commented 1 year ago

They're just different types, the same way the Number 0 and the BigInt 0n are different types. The spec has a third kind of numeric value, "mathematical values", which it generally uses internally and then converts to Number or BigInt values when they get exposed to code. That is, when the spec talks about the length of an empty list being zero, that means the actual concept of zero, not the floating-point number 0; same deal here.

(When dealing with the two infinities we say "extended mathematical values", since those extra two points are not real numbers.)

There's some description in this section.