discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSNumber and long double


From: Daniel J Farrell
Subject: NSNumber and long double
Date: Sat, 5 May 2007 14:21:22 +0100

Hello everyone,

Can NSNumber containing long double data-type? The docs say in order to return a number as a long double, use:

- (long)longValue Returns the receiver's value as a long double precision floating point value.

In the example below I am using +numberWithLong:, however when returned this prints out a NaN.

  long double num = 1e300;
  NSNumber *d = [NSNumber numberWithLong:num];
  printf("\n\n%Le",[d longValue]);

  //output nan

How do I use long doubles with GNUstep?

Cheers,

Dan.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]