Re: simple eurphoria question
- Posted by Alexander Toresson <alexander.toresson at gmail.com> Dec 05, 2006
- 695 views
Evan Marshall wrote: > > john thomas wrote: > > > > > > can someone please tell me how to get the integer part of a number in an > > atom > > in order to assign it to an integer variable > > atom x > integer y > x = 1.1 > > y = floor(x) Yes, that will get the integer part of positive numbers, but it won't get the integer part of negative numbers. For example, -1.1 will be rounded down to -2. I'm afraid you'll have to use some if statements to make it work for negative numbers too (ie if it's a negative number, do the opposite of floor(), which could be named roof() and be a new function you could implement). Regards, Alexander Toresson