Perhaps you are referring to this standard operation? x = (int) (x + 0.5);
Of course, this assumes that x is positive. For details on this, check out the C FAQ, section 14.6. http://www.faqs.org/faqs/C-faq/faq/ Adrien. Tuesday, June 21, 2005, 7:55:40 PM, you wrote: JC> On Tue, 2005-06-21 at 10:15, Udi Kobi wrote: >> Hi, >> What c function is used to get f(1000.3) = 1000 ? >> >> Reagrads, >> >> -Udi >> >> JC> Udi JC> If this were C on Unix or something similar you would use the round JC> function. On palm you really don't have a set of floating point JC> operations unless you use MathLib (this is a separate .prc file with JC> numerouse math functions, run a google search and you'll find it). I JC> know that you can write your own round function (either through some JC> basic arithmetic or via bit manipulation and some knowledge of IEEE 754 JC> floating point representation). Unfortunately I can't remember the JC> trick to this (the basic arithmetic way). Hope this gives you a few JC> leads. JC> John -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
