trunc

Thomas Bähler toeloop at swissonline.ch
Sat Feb 9 14:51:28 EST 2008


Strange beahviour of the trunc function. This script:

on mouseUp
   put 8.1 into Zahl
   put Zahl - trunc(Zahl) into Dezimal
   put Dezimal*60 & comma & trunc(Dezimal*60)
end mouseUp

should return 6,6
but instead I get 6,5

If I change the first line to
   put 8.2 into Zahl

I get 12,11

with
   put 8.3 into Zahl
I get 18,18 as expected

RunRev 2.8.1 on Mac OSX 10.4.11

Any explanation?

Thanks Thomas




More information about the Use-livecode mailing list