On Sat, Apr 22, 2023 at 5:52 PM Bruno Haible <br...@clisp.org> wrote:
>
> Ben Pfaff wrote:
> > determine whether converting 'd' to 'long' would
> > yield a 'long' with the same value as 'd'.
>
> Maybe
>   d == (double) (long) d
> ?
>
> Just a wild guess. I haven't tested it.

I don't trust the undefined behavior in conversions that go outside the
valid range. The program I showed gave me different output with and
without GCC optimization turned on, for example.

Reply via email to