Re: sizeof float in Xcode debugger
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