I don't think that's correct for Python!
I don't think that's correct for Python!
Also, which "many other" languages have only doubles, aside from JavaScript?
[1] https://docs.python.org/3/reference/datamodel.html#the-stand...
I don't think this is true of most languages; only for Lua that I know of. And it causes problem: if you send a 64-bit ID to Lua, which represents it as a double, it will subtly change the last few bits. Then when you go to look up something with that ID, you get the wrong item.
Most languages don't have that problem.
$ echo 'puts [expr 2 ** 128 + 1]' | tclsh
340282366920938463463374607431768211457
$ python3 -c 'print(2 ** 128 + 1)'
340282366920938463463374607431768211457
$ node -p 'Math.pow(2, 128) + 1'
3.402823669209385e+38Anyway, java does not have unsigned int, so there you go.
Edit: if he claims that int-is-float like in javascript, he’s just flat wrong.
No, it’s not. In the base language Python has an int type that is separate from its float type.
See numbers.Integral and numbers.Real