[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IEEE 754R Meeting April 15, 2004 Raw Minutes



>From Eric's notes:
 - Hauser - Does any language support SNaN?
 -       C++ was suppose to but definition conflicts with it.

I'm the one who made the second comment...  The numeric_limits
signaling NaN function returns a SNaN as a value, and the
very act of returning it may cause the signal (and will on
many architectures / ABIs) and return a QNaN + raise the invalid
flag.

The function needs to construct a SNaN in memory.  It should
be something like
  void std::numeric_limits<T>::make_signaling_NaN (T*);
rather than the current
  T std::numeric_limits<T>::signaling_NaN ();
(eliding the obvious "template <typename T>" throughout.)

A "more useful" function to many people would be
  template <typename IterT>
  void
  std::numeric_limits<T>::fill_with_signaling_NaNs (IterT start, IterT finish);
to fill containers with explicitly uninitialized data.  To
implement this portably, you'd need to dig out the memory
location behind each derefenced IterT.  Might not be worth
the extra effort, but something like
  void
  std::numeric_limits<T>::fill_with_signaling_NaNs (T* start, T* finish);
would be.

Jason

754 | revision | FAQ | references | list archive