[Flightgear-devel] Re: [Simgear-cvslogs] CVS: source/simgear/sound soundmgr_openal.cxx, 1.7, 1.8

2004-11-21 Thread Christian Mayer
Curtis L. Olson schrieb:
Log Message:
I don't understand why FreeBSD doesn't see isnan() after including math.h
but it doesn't.  Trying the apple approach to fixing isnan results in an
infinite loop (making me wonder what happens on OSX?)  This is an alternative
approach to checking isnan() on freebsd ...
[...]

+ #if defined (__FreeBSD__)
+ inline int isnan(double r) { return !(r  0 || r  0); }
+ #endif
This test will break if r == 0
CU,
Christian
___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re: [Simgear-cvslogs] CVS: source/simgear/sound soundmgr_openal.cxx, 1.7, 1.8

2004-11-21 Thread Curtis L. Olson
Christian Mayer wrote:
+ #if defined (__FreeBSD__)
+ inline int isnan(double r) { return !(r  0 || r  0); }
+ #endif

This test will break if r == 0

Oops, duhhh!  Thanks!
Curt.
--
Curtis Olsonhttp://www.flightgear.org/~curt
HumanFIRST Program  http://www.humanfirst.umn.edu/
FlightGear Project  http://www.flightgear.org
Unique text:2f585eeea02e2c79d7b1d8c4963bae2d
___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re: [Simgear-cvslogs] CVS: source/simgear/sound soundmgr_openal.cxx, 1.7, 1.8

2004-11-21 Thread Mathias Fröhlich
On Sonntag 21 November 2004 22:46, Curtis L. Olson wrote:
 Christian Mayer wrote:
  + #if defined (__FreeBSD__)
  + inline int isnan(double r) { return !(r  0 || r  0); }
  + #endif
 
  This test will break if r == 0

According to IEEE, NaN is the only fp value that is not equal to itself. That 
is, the code snippet:

inline int isnan(double r) { return r != r; }

should work on any IEEE machine.

Greetings

 Mathias

-- 
Mathias Fröhlich, email: [EMAIL PROTECTED]

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d