Your benchmark looks ok, thanks, although the difference is a little smaller on my machine (-21% / +27%). I did surround your three divisions with int() in the no_integer version.
The above results show that my machine has not floating point hardware?
I doubt it, rather I guess that Perl can simply use more efficient implementations of the mathematical opcodes, that don't need to worry about all the floating-point stuff that Perl hides in its numerical types.
In reply to Re^5: porting C code to Perl -- use integer bench
by haukex
in thread porting C code to Perl
by Discipulus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |