From: Peter Vanroose <peter_vanroose@ya...>  20080206 11:23:11

> int() rounds towards zero. > I need a function that rounds towards inf. If you know that all values are not smaller than (say) 50000, first add (and later subtract again) a suitable power of 2: inline long int my_floor(double x) { return (long int)(x+(1<<16))(1<<16); } The "subtracting a power of 2" implementation on integers roughly swaps all bits. Don't know if this is faster than subtracting any other number. Also don't know whether this makes a difference on doubles.  Peter.  ___________________________________________________ Sök efter kärleken! Hitta din tvillingsjäl på Yahoo! Dejting: http://se.meetic.yahoo.net/index.php?mtcmk=148757 