On Monday 22 Feb 2010 21:10:53 you wrote: > On Mon, Feb 22, 2010 at 7:30 PM, Nick Bailey <[email protected]> wrote: > > Not top of your hit list, this one, I have to admit... But I did notice > > that the values of nsec in instances of the RealTime class don't ever get > > normalised. So that means that the nsec property could wrap after > > repeated arithmetic manipulation, producing a wrong answer. > > > > How about you normalise the value on construction and in the copy > > constructor? > > I'm not quite sure I follow ("normalise" in what sense?) The values > are wrapped in the constructor to ensure the absolute value of nsec is > never greater than one second, and all arithmetic operations use this > constructor to return their values. What cases does this miss? > > > Chris
It misses the cases when I have a caffeine deficit. Sorry Chris! I was just glancing at the file to find out how to convert RealTime to a double, and I should have read it more carefully. I think the no-args constructor put the wrong idea into my head while I was looking for a toDouble method or something like that. And sorry to raise Michael's hopes about killing obscure timing bugs. I need (1) more coffee and (2) to give fewer C lectures to the first years! Nick/. PS: in the end I went for real_time_val/RealTime(1, 0) to get a double, as it avoids touching your core code. Just as well, eh? N/. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Rosegarden-devel mailing list [email protected] - use the link below to unsubscribe https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
