1. Re: Math Shortcuts

Arthur P. Adamson writes:
> Speed demons, note!!! floor() is not fast. On my pentium, one
> million ops for:
> o1 = floor(34.56)              2.42 seconds         vs
> o1 = sqrt(34.56)               1.54    "            vs

Intel has a machine instruction for floating-point sqrt.
I don't think you can beat Euphoria's sqrt(), even if
you compromise on accuracy etc.
Intel also has a machine instruction for *rounding* a f.p.
number to the nearest integer. Unfortunately it can't be used
directly for floor(), which always rounds *down*.

Regards,
     Rob Craig
     Rapid Deployment Software
     http://members.aol.com/FilesEu/

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu