[Numpy-discussion] making the distinction between -0.0 and 0.0..
Tue Sep 29 16:39:43 CDT 2009
On Tue, Sep 29, 2009 at 16:37, Joe Kington <email@example.com> wrote:
> I know it's a bit pointless profiling these, but just so I can avoid doing
> real work for a bit...
> In : import sys, struct, math
> In : def comp_struct(x):
> ...: # Get the first or last byte, depending on endianness
> ...: # (using '>f' or '<f' loses the signbit for -0.0 in older
Did you try 'd'? I wonder if the extra conversion step from a C double
to a C float is causing this issue.
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the NumPy-Discussion