Re: Problems with Time
"Carlo E. Prelz" <[email protected]>
| Newsgroups | gmane.comp.lang.ruby.general |
|---|---|
| Message-ID | <[email protected]> |
Subject: Problems with Time Date: mer 24 apr 19 02:00:09 +0000 Quoting Andy Jones ([email protected]): > I’d expect `time – t` to be slightly different from `Time.now – t`, > of course, but why does it appear to have different precision?– > `Time.now`, `time` and `time – t` are all of class Time, so there–s > nothing funny there? The precision is the same. But when you print 'time-t', you actually print time-(time-(d*60*60*24)) you actually print d*60*60*24 , which is integer, although stored in a floating-point variable. What you see in 'Time::now-t' is slightly larger, and this amount is seen in the decimals (my differences are much smaller than yours...). Carlo -- * Se la Strada e la sua Virtu' non fossero state messe da parte, * K * Carlo E. Prelz - [email protected] che bisogno ci sarebbe * di parlare tanto di amore e di rettitudine? (Chuang-Tzu) Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>