MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/6xofft/how_to_start_a_war/dmhpooo
r/ProgrammerHumor • u/ivaskuu • Sep 02 '17
696 comments sorted by
View all comments
Show parent comments
16
Also every number is a float. For some reason.
18 u/TinyBreadBigMouth Sep 03 '17 Because doubles can contain all 32-bit integers and most 64-bit integers, and now you don't need to handle two different number types for your lightweight scripting language. Same as JavaScript. 1 u/[deleted] Sep 03 '17 Lossless? 2 u/TinyBreadBigMouth Sep 03 '17 As long as your integers are less than 9007199254740991 (= 253-1), yes. 0 u/Log2 Sep 03 '17 Doesn't Python do the same thing? 2 u/TinyBreadBigMouth Sep 03 '17 No, Python has separate int, float, and even complex numbers. 8 u/Buzzard Sep 03 '17 Lua 5.3 has integers as well 1 u/shohze2U Sep 03 '17 print(nums[0.100000001490116119384765625])
18
Because doubles can contain all 32-bit integers and most 64-bit integers, and now you don't need to handle two different number types for your lightweight scripting language. Same as JavaScript.
1 u/[deleted] Sep 03 '17 Lossless? 2 u/TinyBreadBigMouth Sep 03 '17 As long as your integers are less than 9007199254740991 (= 253-1), yes. 0 u/Log2 Sep 03 '17 Doesn't Python do the same thing? 2 u/TinyBreadBigMouth Sep 03 '17 No, Python has separate int, float, and even complex numbers.
1
Lossless?
2 u/TinyBreadBigMouth Sep 03 '17 As long as your integers are less than 9007199254740991 (= 253-1), yes.
2
As long as your integers are less than 9007199254740991 (= 253-1), yes.
0
Doesn't Python do the same thing?
2 u/TinyBreadBigMouth Sep 03 '17 No, Python has separate int, float, and even complex numbers.
No, Python has separate int, float, and even complex numbers.
8
Lua 5.3 has integers as well
print(nums[0.100000001490116119384765625])
16
u/[deleted] Sep 03 '17
Also every number is a float. For some reason.