http://d.puremagic.com/issues/show_bug.cgi?id=6725



--- Comment #5 from Jonathan M Davis <jmdavisp...@gmx.com> 2013-02-08 22:26:54 
PST ---
Without dur or convert taking floating point values, you're forced to do
something like

auto d = dur!"hnsecs"(cast(long)(convert!("seconds", "hnsecs")(1) * 1.5001)));

which is arguably overly verbose, but I really don't think that using floating
point values for time should be encouraged at all. So, it could definitely be
more user friendly, but I'm not sure that doing so would be a good idea. Too
many people already seem willing to use floating point values for time (they
did in the code base that I work on at work until I ported SysTime and Duration
to C++ for work). So, I don't know what the right balance of user friendliness
and good practice is in this case.

TickDuration _does_ support some floating point stuff, but only converting _to_
them, not from them, and it's essentially a fraction internally. Though if I
could go back, I probably would have gotten rid of TickDuration rather than
integrating it into std.datetime, since I really don't think that it buys us
much over Duration (hnsecs is already better precision than most system clocks
anyway), and the fact that it's basically a fraction has caused quite a bit of
trouble. It's particularly nasty when it comes to trying to test it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to