> I also placed in hooks so you can replace the scalarmath (for int,
> float, and complex) with  the Python version of math (this works because
> the int, float, and complex scalars are sub-classes of the corresponding
> Python object).

Just for completeness some more tests using pythonmath/scalarmath for int, 
float or both (in usec per loop):

                            sin - array     mod - array    xx

(a) - (no import of numpy.core.scalarmath)

numpy 0.9.9.2800              152              76.5
numpy 0.9.9.2800 + math        50.2 


(b) - (use_pythonmath(xx))

numpy 0.9.9.2800              107              60.4       (int)
numpy 0.9.9.2800 + math        32.7 
 
numpy 0.9.9.2800              148              43         (float)
numpy 0.9.9.2800 + math        50.7 

numpy 0.9.9.2800              109              26.5       (int, float)
numpy 0.9.9.2800 + math        32.4 


(c) - (use_scalarmath(xx))

numpy 0.9.9.2800              149              77.1       (int)
numpy 0.9.9.2800 + math        50.7 

numpy 0.9.9.2800              147              74.3       (float)
numpy 0.9.9.2800 + math        50.7 

numpy 0.9.9.2800              148              73.5       (int, float)
numpy 0.9.9.2800 + math        50.8  


Maybe use_pythonmath(int, float, complex) should be set as default?

Many thanks,
Steffen

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to