Tim Hockin wrote:
On Mon, Sep 15, 2003 at 05:00:29PM -0600, Mike Berry wrote:
Agreed, but I also think that int should be collapsed into one floating point type, I feel there is some extra simplicity from handling integer values as a hinted float type, eg. automation, interpolation etc. I dont have any religious convition about it though :)
The collapse has a fundamental problem, which is that the range of the int is larger than the range of the float. What I mean by this is that 0x7FFFFFFF can be represented exactly by a 32 bit int, but cannot be represented exactly by a 32 bit float. So the use of floats for ints only works if the mantissa of the float is >= in size to the int. So doubles would work for 32 bit ints, but not 64 bit one. I think that we still need an int type.
Devils' advocate: round or use floor() or something faster (for x86 there is a fast cast lib that works well) . If you use floats to represent ints, you don't need to be exact.
Tim
-- Mike Berry Adobe Systems
---------------------------------------------------------------------- Generalized Music Plugin Interface (GMPI) public discussion list Participation in this list is contingent upon your abiding by the following rules: Please stay on topic. You are responsible for your own words. Please respect your fellow subscribers. Please do not redistribute anyone else's words without their permission.
Archive: //www.freelists.org/archives/gmpi Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe