rauschma / exploring-js

20 stars 0 forks source link

Chapter: Numbers #11

Open rauschma opened 6 years ago

ivansvlv commented 6 years ago

14.3.3. Incrementing (++) and decrementing (--): There is a typo in the second example, highlighted should be suffix I assume:

image

Flooorent commented 5 years ago

You mixed the values of Number.MIN_SAFE_INTEGER and Number.MAX_SAFE_INTEGER in 15.11.3. Safe integers

rauschma commented 5 years ago

@ivansvlv Thanks! This will be fixed in the next release.

rauschma commented 5 years ago

@Flooorent Thanks, the next release will fix this!

wgmyers commented 4 years ago

I have the for-purchase digital version of the book, including quizzes and exercises.

Unfortunately the Numbers (advanced) quiz at the end of this chapter is missing.

damianstasik commented 3 years ago

@rauschma Decimal proposal is now at the stage 1. We are getting closer!

EtherNoteWorld commented 3 years ago

16.4 Table8

Convert the bigint like 1n, I get 1 in browser and Node. Is there a rule in the standard?

gfot2 commented 3 years ago

Hi and thanks for the book! 16.9.3 should be [-2 53 + 1, 2 53 - 1] .

SiarheiBobryk commented 3 years ago

Dear @rauschma! What is the reason for using +0, but not 0? For example, in "Table 8: Converting values to numbers."

ivansvlv commented 3 years ago

Dear @rauschma! What is the reason for using +0, but not 0? For example, in "Table 8: Converting values to numbers."

@SiarheiBobryk I believe it's used to emphasize the fact that it's a positive zero not a negative one, since JavaScript has a signed zero, more info here: http://speakingjs.com/es5/ch11.html#two_zeros

rauschma commented 2 years ago

@EtherNoteWorld That has changed since I initially wrote this text (and will be fixed in the next release). Relevant section in the spec: https://tc39.es/ecma262/#sec-number-constructor-number-value

rauschma commented 2 years ago

@gfot2 Fixed in next release, thanks!

rauschma commented 2 years ago

@SiarheiBobryk: The reason is as explained by @ivansvlv. However, in the book I’m pretending that there is only one zero (I have yet to encounter code where the difference matters). Thus, I’ll simply write 0 instead of +0 in the next release.

LukasMac commented 2 years ago

Section 16.11.2 Static properties of Number

It feels like .POSITIVE_INFINITY should go before .NEGATIVE_INFINITY, since .NEGATIVE_INFINITY refers to description of .POSITIVE_INFINITY.

yanjankaf commented 1 year ago

@rauschma I think in §16.5.2 it really doesn't make any sense to include findIndex and find as logic is defined by the predicate ( function ) that user will write not by language, it's all up to the user whether the function they write is able to find the NaN or not, whether they are checking using Object.is or Number.isNaN or just checking using strict equality or something.