Skip to content

Review 2: issignaling signature #1215

@jzmaddock

Description

@jzmaddock

There is a thing here that we may not be able to reproduce but it happens with
the built-in binary floating point types that the hardware itself handles.
"Looking at"/reading a signaling NaN potentially raises the signal and
then converts it into a silent NaN. AFAIK that includes copying it, but I may
remember wrong. If I am correct (which I may not be) an issignaling function
that takes its argument by copy would always return false as the reading for
copying would turn the source of the actual parameter into a silent NaN (after
raising a signal if requested) and then copy that silent NaN into the
parameter. I may be wrong about that, a test program should be written to
verify how this works with double.

The issue here is that if a CPU or a compiler ever implements decimal floating
point and we would like to update this library to use the native implementation
of these types the issignaling function may stop working due to its signature.

Am I correct in thinking that this function is basically future-proofing the library since we don't actually have any signalling NaNs?

The same argument would apply to read_payload as well.

I note that all the std lib functions that accept a NaN take it by value: the implication being that they will signal if used with a signalling NaN. Maybe read_payload should be the same, and issignalling has no real use - at least not yet?

Metadata

Metadata

Assignees

Labels

Boost ReviewCollected Comments from Boost Review Period

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions