[Numpy-discussion] Questions about the array interface.

konrad.hinsen at laposte.net konrad.hinsen at laposte.net
Mon Apr 11 02:30:28 EDT 2005


On Apr 9, 2005, at 18:54, Travis Oliphant wrote:

> No, in moving from the struct modules character codes we are trying to 
> do something more platform independent because it is very likely that 
> different platforms will want to exchange binary data.   IEEE-754 is a 
> great standard to build

For data exchange between platforms, i.e. through files and network 
connections, XDR is arguably a better choice. It actually uses IEEE for 
floats, but XDR libraries provide conversion code for other platforms. 
It also takes care of byte ordering.

>  an interface around.   Data sharing was the whole reason the standard 
> emerged and a lot of companies got on board.

I think the main reason was standardization of precision, range, and 
operations, to make floating-point code more portable. This has had 
moderate success, as 100% IEEE platforms are rare if they exist at all.

>> Another detail to consider is that although most machines use the 
>> IEEE  representation, hardly any respects the IEEE rules for floating 
>> point  operations in all detail. In particular, trusting that Inf and 
>> NaN will  be treated as IEEE postulates is a risky business.
>
> But, this can be handled with platform-dependendent C-code when and if 
> problems arise.

Can it? I have faint memories about Tim Peters explaining why and how 
handling IEEE in C code is a pain. Anyway, it would be a good idea to 
get his opinion on whatever proposal about IEEE before implementing it.

Konrad.





More information about the NumPy-Discussion mailing list