[PATCH] difftime is pure, not const

Andreas Schwab schwab@linux-m68k.org
Mon May 27 22:25:01 GMT 2024


On Mai 27 2024, Vincent Lefevre wrote:

> On 2024-05-27 22:17:11 +0200, Andreas Schwab wrote:
>> On Mai 26 2024, Paul Eggert wrote:
>> 
>> > Because difftime's behavior depends on the floating-point environment,
>> 
>> Please explain.  Where does it do that?
>
> Because time_t is typically a 64-bit type and double typically
> has a 53-bit significand, so that the result needs to be rounded
> in some unspecified way[*]?

That can never happen for existing timestamps.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


More information about the Libc-alpha mailing list