Re: ICONS...(DEAD HORSE I KNOW)
- Posted by Daniel Johnson <dpj22 at CAM.AC.UK> Feb 08, 2000
- 385 views
# If you want to round to the nearest integer: # # function round( atom number ) # return floor( number + 0.5 ) # end function Although we all know that float() is horribly slow, in fact slower than sqrt(). In a thread a long time ago this was discussed, and Rob explained that Intel have a round() and sqrt() instruction on the chip but floor() has to be done in software. What I cannot remember ever being told was why, if this is the case, we have floor() and do not have round(). Also why we could not have both, and why floor() cannot be hardcoded to be intel:machine_round(x-.5) [pseudocode] Rob ? -- Daniel Johnson Engineer, smartypants and clown Jesus College, Cambridge all at a very reasonable price dpj22 at cam.ac.uk zeus.jesus.cam.ac.uk/~dpj22 talk dpj22 at jewish.jesus.cam.ac.uk