• 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: EndianU32_NtoB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EndianU32_NtoB


  • Subject: Re: EndianU32_NtoB
  • From: "Sean McBride" <email@hidden>
  • Date: Fri, 30 Oct 2009 20:09:05 -0400
  • Organization: Rogue Research Inc.

On 10/30/09 7:52 PM, Adam R. Maxwell said:

>>> I don't get why for ints they have host<->big, host<->little,
>>> etc. for the floats they don't.  Instead they have those weird host<-
>>>>
>>> swapped. And though they take floats, they return structs.
>>
>> I think this is to avoid storing swapped floats in 'float' variables.
>A swapped int is a valid int, but a swapped float is often an invalid
>IEEE floating-point value. My suspicion is that the CPU might mistreat
>such values when they're read into FP registers, even if no arithmetic
>is done on them in that state. (But that's just a suspicion; anyone know
>the gory details?)
>
>This old thread seems to confirm your suspicion:
>
>http://www.omnigroup.com/mailman/archive/macosx-dev/2002-October/042692.html
>
>...and IIRC this message was particularly useful in demonstrating how to
>use NSSwappedFloat:
>
>http://www.omnigroup.com/mailman/archive/macosx-dev/2002-October/042705.html

Nice find.  So the NS float swapping functions _do_ have little<->host
and big<->host versions, ex: NSSwapLittleFloatToHost.  I still don't get
why the CF versions do not.  ie why is there no
CFSwapFloat32LittleToHost?  They only have those weird host<->swapped
versions.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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

References: 
 >EndianU32_NtoB (From: "gMail.com" <email@hidden>)
 >Re: EndianU32_NtoB (From: "Sean McBride" <email@hidden>)
 >Re: EndianU32_NtoB (From: Kyle Sluder <email@hidden>)
 >Re: EndianU32_NtoB (From: "Sean McBride" <email@hidden>)
 >Re: EndianU32_NtoB (From: Jens Alfke <email@hidden>)
 >Re: EndianU32_NtoB (From: "Adam R. Maxwell" <email@hidden>)

  • Prev by Date: Tab View Issue
  • Next by Date: Re: Tab View Issue
  • Previous by thread: Re: EndianU32_NtoB
  • Next by thread: Re: EndianU32_NtoB
  • Index(es):
    • Date
    • Thread