Posted by vendredi5h on 06/10/06 14:00
Tim Roberts a écrit :
> >I'd like to split a 64-bits word (hold as a floating point number) into
> >two 32-bits words (hold as integers). Bitwise operators are working on
> >Integers, not on floating point.
> >
> >Anyone can tell me how I can do this?
>
> Impossible in straight PHP. You can't get access to the bits.
Ok.
> You could do it with a C extension. What are you actually trying to do?
That's a kind of experimentation of a floating point dissection. As
with rats in high school! :o) But the goal is to get the n most
significant bits of a floating point fraction part and keep them for
futur use. Any other suggestion?
I would prefer PHP but I can do this little program in C too.
Yannick
Navigation:
[Reply to this message]
|