Hi Victor, This is somewhat related and is a question for everyone: in H/sysdep.h, if USE_LRINT is enabled, does the code in there: 230 # define MYFLT2LONG(x) ((long) lrintf((float) (x))) not yield a different result than: 263 # define MYFLT2LONG(x) ((long) (x)) ? I guess I'm wondering what that code is all about. Thanks! steven On 10/21/06, Victor Lazzarini wrote: > A question for any int to float guru out there (Erik?), > which of the two truncation codes below would be faster? > > (1) > double a; long b; > b = (long) a; > > (2) > double a; long b; > b = lrint(a); > b = b <= a ? b : b - 1; > > (both assuming positive numbers only). > I suppose my question is whether b <= a, comparing > fixed and floating-point, involves any casting > that might slow down things. > > I would expect that if there is any casting it would > be long -> double; I suppose that does not carry > any penalty, or does it? > > Thanks > > Victor > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Csound-devel mailing list > Csound-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/csound-devel > ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net