On Oct 26, 2009, at 11:26 AM, Ian Piper wrote:
So I am guessing that when I get a float displayed as "inf" this is not the string it seems to be. Also, it looks like the string value of whatever is coming back is not something that I can use. Can anyone suggest how I might handle a test case like this?

As Kyle noted, -stringValue returns an NSString, not a char*. You'd need to compare to @"inf" and print with %...@.

A better way to check for floating-point +infinity and -infinity is to use the isinf() macro.

    if (isinf([number floatValue])) {
        NSLog(@"number is +inf or -inf");
    }


--
Greg Parker     gpar...@apple.com     Runtime Wrangler


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to