This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: numeric_limits implementation


"Rich Churcher <Rich" <churchmouse@mpx.com.au> writes:

| In implementing & specialising numeric_limits for gcc
| i686-pc-linux-gnu, what should I use as meaningful return values for
| the following member functions? 
| 
|   static T infinity() throw();
|   static T quiet_NaN() throw();
|   static T signaling_NaN() throw();

they are meaningful only when one has respectively 

	has_infinity != false
	has_quiet_NaN != false
	has_signaling_NaN != false

ans is_iec559 == true. Otherwise you can just give your favorite
value.  Please look at the libstdc++-v3 implementation to see what is
being done.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]