Time - Time to return a Rational
Currently subtracting a Time from a Time returns a Float, which I guess causes #12952
Is there any reason this doesn't return a Rational?
Updated by akr (Akira Tanaka) about 3 years ago
It is because ruby-dev:38446 by mame-san.
Updated by mame (Yusuke Endoh) about 3 years ago
I think of one philosophical reason and one practical reason.
A philosophical reason: many Time objects are inherently inexact. Since a Rational is considered exact, returning a Rational might convey the wrong message that the Time objects are exact.
A practical reason: Time is often used for a simple benchmark tool. Consider "
t = Time.now; ...; p Time.now - t" prints, such as
(1590642983/500000000). It is difficult for human to read and compare the result.