On August 10, 2015 10:06:43 EDT, Gavin Lambert
Try normalising the milliseconds to seconds before putting them in
of the formula. You should be able to do this simply by assigning
On 11/08/2015 01:43, Michael Powell wrote: the rest them to a
seconds quantity type instead of using "auto".
I'm not sure what you mean, "seconds quantity type"?
There would be quantity<time> ?
Yes. I have this:
typedef quantity<time> Time;
And explicitly use "Time" as the type for all time-related results instead of using "auto".
Which one can assign from (time_value * seconds), to arrive at seconds?
It is possible to build up a milliseconds unit, or possible a milliseconds_to_seconds "conversion factor" ?
You can, but it's not necessary. Simply assign value * milli * seconds
to a variable of quantity<time> (aka Time) and it automatically converts everything to seconds (since that's the base unit of "time"). This prevents other operations getting confused by scaled units, which happens when you use "auto" because it skips this conversion.
Ah I gotcha. So the prevailing wisdom is auto auto auto, except when quantities and prefixed unit conversions are concerned. Thank you...
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Sent from my Android device with K-9 Mail. Please excuse my brevity.