• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Assignment problem with doubles: turning into NaN under Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Assignment problem with doubles: turning into NaN under Leopard


  • Subject: Re: Assignment problem with doubles: turning into NaN under Leopard
  • From: Frank Illenberger <email@hidden>
  • Date: Thu, 6 Dec 2007 20:29:51 +0100

John,

in my application, I certainly have an interface declaration for the method and I therefore don't get any warnings. Even in this example, the "methodValue" method stands before the caller. The problem does not seem to be trivial.

Cheers

 Frank

On 06.12.2007, at 20:10, John Stiles wrote:

If the compiler doesn't have an interface declaration for "methodValue" at the location of "test," you will get:
(a) a compiler warning
(b) results similar to what you describe



Frank Illenberger wrote:
Hi guys,

I am currently trying to track down a very strange problem that only occurs on Intel Macs under Leopard. At various locations in my application, assignments from a method return value to a local double variable result in the variable containing NaN although the method result is 0.0.

Example:

- (double)methodValue
{
   return 0.0;
}

- (void)test
{
   double value = [self methodValue];
       if(isnan(value))
       NSLog(@"PROBLEM!");
}


The problem does not always occur, but is rather following strange patterns. It reproducibly occurs inside my application but not in any test case I constructed. The problem does not occur if I put a NSLog statement before the assignment. The problem in my case has definitely nothing to do with nil-messaging or threading.


During today's research I found a similar case in the gcc mailing list from 1999
http://gcc.gnu.org/ml/gcc-bugs/1999-10/msg00196.html
This case was described as libc corrupting the FP stack so that following FP operations could fail.


Has anybody encountered a similar problem in applications running on Intel machines under Leopard?

Cheers

Frank



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Assignment problem with doubles: turning into NaN under Leopard
      • From: Alastair Houghton <email@hidden>
References: 
 >Assignment problem with doubles: turning into NaN under Leopard (From: Frank Illenberger <email@hidden>)
 >Re: Assignment problem with doubles: turning into NaN under Leopard (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Assignment problem with doubles: turning into NaN under Leopard
  • Next by Date: how to instantiate MyDocument with file from open panel?
  • Previous by thread: Re: Assignment problem with doubles: turning into NaN under Leopard
  • Next by thread: Re: Assignment problem with doubles: turning into NaN under Leopard
  • Index(es):
    • Date
    • Thread