[Cfp-interest 2124] Re: FP_NAN, ...

Vincent Lefevre vincent at vinc17.net
Wed Aug 25 06:19:40 PDT 2021


On 2021-08-24 22:33:28 -0600, Fred J. Tydeman wrote:
> Suppose an implementation (such as IBM S/360 hex FP) which has no support
> for any of:  NaN, infinity, or subnormal numbers.  Should it be required to define:
> FP_NAN
> FP_INFINITE
> FP_SUBNORMAL
> Perhaps those macros should be defined "if and only if supported".

I disagree. This would complicate portable software, which may use
tests like:

  if (class == FP_NAN)

(if NaN is not supported, then the test will be always false, so
no issues). If FP_NAN definition becomes optional, then the code
would need to be changed to something like

#ifdef FP_NAN
  if (class == FP_NAN)
...
#endif

and this would be even more complicated when such tests are needed
in macros (where using #if/#ifdef is not possible).

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the Cfp-interest mailing list