2011/10/17 Gael Varoquaux <[email protected]>:
> On Mon, Oct 17, 2011 at 12:15:48PM +0200, Lars Buitinck wrote:
>> 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>.
>
> OK, I am not too good at this. Do you think that you could help me with
> it?

Ehm, I'm not too good at this either, but frexpf works as follows:


#include <math.h>
#include <pymath.h>

/* in a function */
int exponent;
float mantissa = frexpf(x, &exponent);


I don't really follow your bit fiddling, so this is as far as I get...
frexpf is very likely a macro or a built-in, so with a good compiler
there's no overhead involved.

Also, be careful with the inline keyword, it doesn't always mean what
you think it does. For full portability, I think you may have to
declare the fast_log and fast_log2 functions "static inline". Your
code should work with any ISO C99-compliant compiler, but
unfortunately Microsoft never adopted that standard. I don't know how
MSVC responds to "inline".
http://www.greenend.org.uk/rjk/2003/03/inline.html


-- 
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