Math problem

Peter M. Brigham, MD pmbrig at gmail.com
Fri Feb 17 22:13:37 EST 2012


On Feb 17, 2012, at 6:39 PM, Geoff Canyon Rev wrote:

> My original function took the number to be rounded and the increment to
> round up to, so I think your version would become:
> 
> function roundUp x,i -- rounds x up to the next i
>  return x div i * i + item itemoffset((x mod i > 0),"true,false") of (i,0)
> end roundUp
> 
> On Fri, Feb 17, 2012 at 1:49 PM, Peter M. Brigham, MD <pmbrig at gmail.com>wrote:
> 
>> function roundUp x
>>  return trunc(x) + char itemoffset((x mod 1 > 0),"true,false") of "10"
>> end roundUp

Sweet!

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig





More information about the use-livecode mailing list