Even if it did force all numbers to be floating-point, the range of integers which can be represented precisely in double-precision (eight-byte) IEEE floating point format is a superset of both signed and unsigned 32-bit fixed-point notation.
Floating-point has a certain reputation, but much of it is undeserved, at least for plain integer math. Lua, for example, treats all numbers as double-precision floating point by default on platforms with an FPU; there is no separate integer type. You only run into problems when you exceed 52 significant bits. (Note that any fraction with a factor larger than two in the denominator requires infinite significant bits, which is obviously much more than 52. This is where most of the reputation originates. However, it doesn't affect integers.)
They should be paying attention to the lumberjack project
Posted Apr 14, 2012 10:58 UTC (Sat) by liljencrantz (subscriber, #28458)
[Link]
JavaScript does the same.
They should be paying attention to the lumberjack project
Posted May 30, 2012 21:38 UTC (Wed) by scientes (guest, #83068)
[Link]
>(Note that any fraction with a factor larger than two in the denominator requires infinite significant bits, which is obviously much more than 52. This is where most of the reputation originates. However, it doesn't affect integers.)
not really. It's rather, any factor with a denominator that is not in the part of the set 2^n, (or with decimal floating point, 2^n * 5^m)
They should be paying attention to the lumberjack project
Posted May 31, 2012 0:19 UTC (Thu) by nybble41 (subscriber, #55106)
[Link]
>> (Note that any fraction with a factor larger than two in the denominator requires infinite significant bits, which is obviously much more than 52. This is where most of the reputation originates. However, it doesn't affect integers.)
> not really. It's rather, any factor with a denominator that is not in the part of the set 2^n, (or with decimal floating point, 2^n * 5^m)
I was referring to the prime factors; any number of the form 2^n * 5^m with naturals n and m (!= 0) has prime factors 2 and 5. A number with a prime factor of 3 or 7, for example, would not terminate in either binary or decimal. However, your description is equivalent.