Re: Big/little endian conversion
- From: Pascal Bourguignon <spam@xxxxxxxxxxxxxxxx>
- Date: Mon, 05 Dec 2005 11:46:22 +0100
Gianni Mariani <gi2nospam@xxxxxxxxxx> writes:
> David Schwartz wrote:
>> "Gianni Mariani" <gi2nospam@xxxxxxxxxx> wrote in message
> ...
>> Why? When you can write clearer, easier to understand and
>> maintain code that will work regardless of the system's native
>> format. What's the advantage?
>
> Little endian and big endian are well defined for integral types. Is
> there a clear spec for IEEE formatted floating point representations ?
Yes.
The question is whether the target processor/compiler respect them.
Actually, I don't remember any bytesex consideration in the IEEE stuff
I read.
I assume an abstract bit field is used to encode an IEEE floating
point number, and some processors choose to store this bit field as a
bytesexed integer instead of storing the bits in the same order as the
others.
> So, if I was too lazy to look it up (which I usually am), the code
> posted by Bjorn Reese would work.
>
> In Bjorn's code, the knowledge of how the floating point layout works
> is extracted from the compiler itself.
>
> I'll take back my previous comment on being able to find broken
> assumtions by a few judicios assert calls.
--
__Pascal Bourguignon__ http://www.informatimago.com/
"You question the worthiness of my code? I should kill you where you
stand!"
.
- References:
- Big/little endian conversion
- From: mobenoua
- Re: Big/little endian conversion
- From: Bjorn Reese
- Re: Big/little endian conversion
- From: Gianni Mariani
- Re: Big/little endian conversion
- From: Bjorn Reese
- Re: Big/little endian conversion
- From: David Schwartz
- Re: Big/little endian conversion
- From: Gianni Mariani
- Re: Big/little endian conversion
- From: David Schwartz
- Re: Big/little endian conversion
- From: Gianni Mariani
- Re: Big/little endian conversion
- From: David Schwartz
- Re: Big/little endian conversion
- From: Gianni Mariani
- Big/little endian conversion
- Prev by Date: Re: Asynchronic communication between application in Linux.
- Next by Date: Re: malloc/free question
- Previous by thread: Re: Big/little endian conversion
- Next by thread: Re: Big/little endian conversion
- Index(es):
Relevant Pages
|