Hi all, I have recently written a paper titled "Faster Floating Point to Integer Conversions" which can be read here:
http://mega-nerd.com/FPcast/ >From the introduction: In many applications such as audio, video and graphics processing, calculations are done with floating point values and the final results converted to integer. There are a number of ways of converting from floating point to integer with the C cast mechanism being the most commonly used. Unfortunately, casting from float or double to int on i386 can cause large performance hits when this operation is used frequently. If the programmer considers the speed of the operation more important that the type of conversion between float and int, speed improvements of 6 to 10 times can be achieved on Pentium III and Athlon CPUs. It is highly likely this is also the case on other processors such as PowerPC. This paper investigates the reasons why the C cast operation which is so important for many applications is so slow and provides an alternative which aims to be as portable as possible. Hope people find this useful. Cheers, Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo [EMAIL PROTECTED] (Yes it's valid) +-----------------------------------------------------------+ "These are the finest moments in (post)modern life, when satire is completly indistinguishable from reality... I usually have to rely on the presidential elections for such dada." -- frenomulax on Jesux a christian Linux distro.