impatient-js icon indicating copy to clipboard operation
impatient-js copied to clipboard

Chapter: Numbers

Open rauschma opened this issue 6 years ago • 15 comments

rauschma avatar Jun 26 '18 16:06 rauschma

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

image

ivansvlv avatar Sep 21 '18 06:09 ivansvlv

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

Flooorent avatar Jan 15 '19 09:01 Flooorent

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

rauschma avatar Mar 23 '19 17:03 rauschma

@Flooorent Thanks, the next release will fix this!

rauschma avatar Mar 23 '19 17:03 rauschma

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.

wgmyers avatar Aug 31 '20 07:08 wgmyers

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

damianstasik avatar Mar 13 '21 13:03 damianstasik

16.4 Table8

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

EtherNoteWorld avatar Apr 09 '21 06:04 EtherNoteWorld

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

gfot2 avatar May 24 '21 08:05 gfot2

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

SiarheiBobryk avatar Jul 25 '21 11:07 SiarheiBobryk

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

ivansvlv avatar Jul 26 '21 19:07 ivansvlv

@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 avatar Jan 02 '22 12:01 rauschma

@gfot2 Fixed in next release, thanks!

rauschma avatar Jan 02 '22 12:01 rauschma

@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.

rauschma avatar Jan 02 '22 12:01 rauschma

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.

LukasMac avatar Apr 17 '22 12:04 LukasMac

@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.

yanjankaf avatar Sep 05 '23 07:09 yanjankaf