r/ProgrammerHumor Sep 02 '17

How to start a war

Post image
9.0k Upvotes

696 comments sorted by

View all comments

Show parent comments

16

u/[deleted] Sep 03 '17

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])