Welp, I actually expected JS to behave same way as python and produce false. I've never been so wrong.
false
Yeah, Python doesn't tell you about short, long, float and double and it automates this; but for JavaScript, it is always double.
short
long
float
double
I am actually stumbled in standard Python that it is False, instead of throwing an error. It will not be the case in Kotlin.
False
>>> 2 ** 64 == 2 ** 64 + 1 False >>> type(2 ** 64 + 1) <class 'int'>
Now, I can ask on StackOverflow, but SO is such as scary place. There is this in Quora, but not many wants to answer.
It seems that it is bignum, actually. You don't even have to care about Decimal, unless you care about 0.1 + 0.2
0.1 + 0.2
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Welp, I actually expected JS to behave same way as python and produce
false
. I've never been so wrong.Yeah, Python doesn't tell you about
short
,long
,float
anddouble
and it automates this; but for JavaScript, it is alwaysdouble
.I am actually stumbled in standard Python that it is
False
, instead of throwing an error. It will not be the case in Kotlin.Now, I can ask on StackOverflow, but SO is such as scary place. There is this in Quora, but not many wants to answer.
It seems that it is bignum, actually. You don't even have to care about Decimal, unless you care about
0.1 + 0.2