Math problems?

Mark Wieder mwieder at ahsoftware.net
Sun May 21 19:48:28 EDT 2006


Dar-

Saturday, May 20, 2006, 4:18:10 PM, you wrote:

> What would you recommend as the new behavior for Revolution trunc()?

Actually, I'm quite happy with what I posted as new behavior. I never
use trunc() by itself anymore, always tacking an empty string onto the
end. This gives the desired behavior.

return trunc(tVal & "")

The "problem" isn't with the internal math routines - they're
implemented properly. The disconnect comes about when trying to
display or return a truncated result of a calculation, when rev
converts the calculated result into a displayable string. Tacking an
empty string before truncating always gives the correct answer. I
think if rev implemented this internally in the trunc() function then
someone wouldn't trip over this every year or so...

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the Use-livecode mailing list