• 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: sizeof float in Xcode debugger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sizeof float in Xcode debugger


  • Subject: Re: sizeof float in Xcode debugger
  • From: Jeffrey Oleander <email@hidden>
  • Date: Mon, 23 Jun 2008 10:03:20 -0700 (PDT)

> Andy Lee <email@hidden> wrote:
>> On 2008 Jun 23, at 11:37, Michael McLaughlin wrote:
>> For instance, a float which, in memory, is
>>
>> 3F4D53D0
>>
>> in both debuggers is rendered in the CodeWarrior
>> debugger as
>>
>> 0.802060
>>
>> but shows up in Xcode (GDB) as
>>
>> 0.802060127

>  From this I would simply assume the two debuggers
> choose a different level of precision for displaying
> floats.

Yes, that's most likely.

> What happens if you print them in both
> environments with the following?
>
>      NSLog(@"float is %.12f", myFloat);

>> I doubt that a float could really have nine sig.
>> figs. as Xcode indicates

> Why do you doubt this?

Because a 32-bit word can generally only
give you just less than 7 reliable decimal
digits from a floating-point number.
You usually have to go to 60 or 64 bits
to get from 7 to about 15 decimal digits.
Of course, that depends a little on how
you divvy up the bits into exponent and
mantissa, but these are the practical /
empirical limits I recall.



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: sizeof float in Xcode debugger
      • From: Thomas Davie <email@hidden>
References: 
 >Re: sizeof float in Xcode debugger (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: sizeof float in Xcode debugger
  • Next by Date: Re: Xcode include/import question (probably dumb)
  • Previous by thread: Re: sizeof float in Xcode debugger
  • Next by thread: Re: sizeof float in Xcode debugger
  • Index(es):
    • Date
    • Thread