Why does JavaScript returns that?

Vyacheslav :

So, my question is why:

1.7976931348623157E+308 > 10^16 returns 17 in Google Chrome,
and (1.7976931348623157E+308) > (10^16) returns true?

Because it looks like these operations are the same.

Scott Hunter :

The first expression is equivalent to

(1.7976931348623157E+308 > 10) ^ 16

or

true ^ 16

Which seems strange, until you realize that

true == 1

is true.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=198008&siteId=1