[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Comment about IEEE floating-point rounding... (was: Setting Float Precision in Lua.c)
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 26 Jun 2018 15:08:30 -0300
>> print(1e97 % 97)
> 3.0
>
> I don't think any of these are right.
The correct result is 10 because of Fermat's little theorem[1] since
97 is prime.
[1] https://en.wikipedia.org/wiki/Fermat%27s_little_theorem