From: Steven Jenkins Date: 2005-04-01T04:23:00+09:00 Subject: Re: Integer/Float oddity michael.b.masi@gmail.com wrote: > [snip] > i'm assuming that since this behaviour is exhibited in ruby and the > rest of the above "other languages" and NOT xbasic that it is really > due to an idiosyncracy of xbasic that the "right" answer comes out. > > so the question becomes, what is different about xbasic's internal > numeric representation that allows it to give a correct answer to this > seemingly simple number manipulation? Nothing. It's just that Xbasic (apparently) defines INT() to mean "closest integer" and some other languages define it to mean "largest integer not exceeding". Both give results consistent with their definitions. Either one gives you what you need to round *or* truncate. round(x) is equivalent to truncate(x + .5) Steve