Boost logo

Boost :

From: John Maddock (jz.maddock_at_[hidden])
Date: 2022-02-22 08:59:47


On 21/02/2022 22:57, Gero Peterhoff via Boost wrote:
> Hello John,
> i tinkered a bit so that std::isnan+std::fpclassify now also work with the value NANS (numeric_limits::signaling_NaN).
> For this i used the coming types and functions (stdlib.h). gcc supports this. That's why i don't want to speak directly of a patch, since this still has to be adapted for other compilers. It all boils down to that anyway, so please treat this as a pattern.
> The functions returns the same values ​​as the gcc-builtins. However, i cannot say at the moment whether these are actually correct. But i have the feeling that not all of them are correct, since the (bit)schemes differ in part.

Apologies for the delay, I meant to reply to your previous message: 
here's the basic issue, yes you can create a __float128 which has the
bit pattern a signalling NaN would have if supported, but based on my
local tests on Mingw it's not actually supported by GCC or clang - which
is to say they don't *raise a signal when used*.

Unless you have a use case, and/or can show that __float128 is capable
of raising a floating point exception when loaded into memory (and
remember that we're talking about a type that is really a software
emulation under the hood), then I just don't see signally NaN's as being
supported for this type?

Thanks, John.

>
> adjusted (boost/math/cstdfloat)
>
> cstdfloat_types.hpp:
> add BOOST_CSTDFLOAT_FLOAT128_HUGE_VAL
>
> cstdfloat_limits.hpp:
> add forward-declarations for nanq/nansq
> in numeric_limits:
> change has_signaling_NaN to true, correct ?
> change infinity
> change quiet_NaN
> change signaling_NaN
>
> cstdfloat_cmath.hpp:
> add in detail:: a lot of functions
> change #define BOOST_CSTDFLOAT_FLOAT128_NAN
> add #define BOOST_CSTDFLOAT_FLOAT128_NANS
> change nanq
> add nansq
> add in std:: a lot of usings and functions
>
> regards
> Gero
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

-- 
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk