numberWithDouble:NaN
How do you do this? [NSNumber numberWithDouble:NAN] NAN is defined as __builtin_nanf("0x7fc00000") in math.h Thanks, Joel --- http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
I'd say something like: a = NSNumber.numberWithDouble(0.0/0.0) which returns the exact same thing as: a = (0.0/0.0) Why do you need that? :P -- Thibault Martin-Lagardette On Jan 7, 2011, at 15:52, Joel Reymont wrote:
How do you do this?
[NSNumber numberWithDouble:NAN]
NAN is defined as __builtin_nanf("0x7fc00000") in math.h
Thanks, Joel
--- http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
On Jan 7, 2011, at 5:21 PM, Thibault Martin-Lagardette wrote:
I'd say something like: a = NSNumber.numberWithDouble(0.0/0.0) which returns the exact same thing as: a = (0.0/0.0)
Does the resulting NaN automatically convert to NSNumber? I need to pass the object initialized this way to a function in another framework, e.g. [focusParameter setNumberValue:[NSNumber numberWithDouble:NAN]]; --- http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
Yep. Laurent On Jan 7, 2011, at 9:41 AM, Joel Reymont wrote:
On Jan 7, 2011, at 5:21 PM, Thibault Martin-Lagardette wrote:
I'd say something like: a = NSNumber.numberWithDouble(0.0/0.0) which returns the exact same thing as: a = (0.0/0.0)
Does the resulting NaN automatically convert to NSNumber?
I need to pass the object initialized this way to a function in another framework, e.g.
[focusParameter setNumberValue:[NSNumber numberWithDouble:NAN]];
--- http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
participants (3)
-
Joel Reymont
-
Laurent Sansonetti
-
Thibault Martin-Lagardette