Math problems?

Richard Gaskin ambassador at fourthworld.com
Sat May 20 16:54:40 EDT 2006


Mark Wieder wrote:

> Peter-
> 
> Friday, May 19, 2006, 12:04:55 PM, you wrote:
> 
>> I am doing the following:
> 
>> put 10.27 into tNumber
>> put the trunc of tNumber into tInteger
>> put tNumber - tInteger into tDecimal
>> put 100 * tDecimal into tNew Decimal
>> put the trunc of tNewDecimal
> 
>> and I get 26 instead of 27.
> 
>   put trunc(tNewDecimal & "")
> 
> forcing it into a string does the trick. Better yet,
> 
> function truncate pValue
>   return trunc(pValue & "")
> end truncate
> 
> Note: this is BZ #2419, which for some reason Tuviah closed as
> NOT_A_BUG in January 2004, so unless Jacque reopens it it's unlikely
> that it will be fixed.

This sounds very much like an issue we batted around here last year with 
trunc that turned out to be a "feature" of the processor....

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com



More information about the use-livecode mailing list