[cfp-interest 3712] Re: [SC22WG14.34253] Sign of zero from fromfp functions
Jim Thomas
jaswthomas at sbcglobal.net
Fri Nov 7 17:15:03 PST 2025
ISO/IEC 60559 requires its conversion operations that correspond to the C fromfp functions to preserve the sign of numeric input. The Annex F binding and deference to ISO/IEC 60559 implicitly give the fromfp functions the same specification. CFP will look into making this specification explicit.
- Jim Thomas
> On Nov 7, 2025, at 11:30 AM, Joseph Myers <josmyers at redhat.com> wrote:
>
> Do the fromfp functions follow the same rules about the sign of a zero
> result as all the other functions rounding to an integer in a floating
> type (i.e., the sign of a zero result is the sign of the floating
> argument)? In particular, is it correct that the ufromfp functions return
> -0 when a negative argument rounds to 0? The issue of the sign of a zero
> result was introduced when we changed these functions to return a floating
> type for C23 (N2548), but we didn't add any text to the standard
> discussing it for these functions.
>
> --
> Joseph S. Myers
> josmyers at redhat.com
>
More information about the cfp-interest
mailing list