mirror of
https://github.com/TomHarte/CLK.git
synced 2025-07-29 23:24:43 +00:00
Fixed Time
addition, added accumulation of distance into track into the disk drive, added a short circuit for LCM.
This commit is contained in:
@@ -49,9 +49,21 @@ struct Time {
|
||||
{
|
||||
Time result;
|
||||
result.clock_rate = NumberTheory::least_common_multiple(clock_rate, other.clock_rate);
|
||||
result.length = length * (clock_rate / result.clock_rate) + other.length * (other.clock_rate / result.clock_rate);
|
||||
result.length = length * (result.clock_rate / clock_rate) + other.length * (result.clock_rate / other.clock_rate);
|
||||
return result;
|
||||
}
|
||||
|
||||
inline void set_zero()
|
||||
{
|
||||
length = 0;
|
||||
clock_rate = 1;
|
||||
}
|
||||
|
||||
inline void set_one()
|
||||
{
|
||||
length = 1;
|
||||
clock_rate = 1;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user