logoalt Hacker News

xmcqdpt2today at 1:14 PM1 replyview on HN

See 6.2.3 in the 2019 standard.

> 6.2.3 NaN propagation

> An operation that propagates a NaN operand to its result and has a single NaN as an input should produce a NaN with the payload of the input NaN if representable in the destination format.

> If two or more inputs are NaN, then the payload of the resulting NaN should be identical to the payload of one of the input NaNs if representable in the destination format. This standard does not specify which of the input NaNs will provide the payload.


Replies

ekelsentoday at 3:16 PM

As the comment below notes, the language should means it is recommended, but not required. And there are indeed platforms that do not implement the recommendation.

show 1 reply