[chuck-users] feeble time printing
Tom Lieber
tom at alltom.com
Fri Oct 16 01:43:56 EDT 2009
2009/10/14 Robert Poor <rdpoor at gmail.com>:
> You would expect that two time values that print identically would compare
> as equal. But I can show you a case where t0 and t1 print as "44100.000000"
> yet they're not equal. You'd also expect t1 to have a fractional part of
> 0.0. But in this case:
>
> <<< (t1 % 1::second) >>> prints "1.000000"
>
> and
>
> <<< t1 - (t1 % 1::second) >>> prints "44099.000000"
You could always use (t0 + "") == (t1 + "").
tongue =< cheek;
I never expect that two floats can be equal, except, on rare occasions, zeroes.
--
Tom Lieber
http://AllTom.com/
More information about the chuck-users
mailing list