2011/10/17 Gael Varoquaux <[email protected]>:
> The question is: is it acceptable to have such an approximation? I think
> so, I just wanted confirmation. If people agree with this, I'll document
> it better (and maybe test it) and push to master.

-1 for the code in its current state; this is a potential maintenance
nightmare. The cast to int* violates C aliasing rules, so this might
break on agressively optimizing compilers. float and int are not
guaranteed to both the 32 bits wide (in fact, neither of them is). I'm
no floating-point expert, but I expect this to break the moment it's
ported to, say, a Cell processor, or anything that is not
x86-compatible.

If you really want to play this kind of tricks, then please use
standard C functionality such as frexp() from <math.h> and appropriate
symbolic constants from <float.h>.

-- 
Lars Buitinck
Scientific programmer, ILPS
University of Amsterdam

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to