On 22/07/2008, at 10:20 PM, Steven Hamilton wrote:

Hi folks,
Can anyone tell me the most efficient way to unsign a floatvalue in an NSNumber?

Like change a -1.47 to 1.47 ?

Thanks


//      Below reverses the sign of, in this case, a float       
        float y, x; y = x = -12.0;
        y -= x * 2; // reverses the sign of x.
        printf("y = %f\n", y); // y = 12.000000

I don't think there's a method on NSNumber which does it for you, so obviously you'd need to extract the value from your NSNumber instance and then use the new value in a new NSNumber.

HTH,

Ron
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to