Converter's methods unixToAtomic and atomicToUnix are renamed to unixMillisToAtomicMillis and atomicMillisToUnixMillis respectively. New methods unixToAtomic and atomicToUnix are introduced; these perform exact calculations on Rats. unixMillisToAtomicMillis and atomicMillisToUnixMillis now call out to these.
Methods are renamed back in index.js.
Open/closed ranges are now handled a little differently internally. We now flag open: true or just omit that flag entirely.
Massively overhaul Converter's unit tests to test the new unixToAtomic and atomicToUnix methods, and to be much more exhaustive testing time conversions around points of interest.
gcd's behaviour is no longer to always return a GCD with the same sign as b. It's now Rat's job to do that sign conversion.
Function millisToExact is now Rat.fromMillis, a static method.
exactToMillis is now Rat.prototype.toMillis.
Behaviour of munge has been modified slightly to account for the possibility of zero-length segments between two smears, specifically between two stalls.
Stop using Rat.prototype.cmp and eliminate it. Just subtract. The "numerator sign is authoritative" property makes this much easier.
tai-data.js's exports UNIX_START and UNIX_END are been renamed to UNIX_START_MILLIS and UNIX_END_MILLIS respectively. New exports UNIX_START and UNIX_END are introduced; these are Rats.
These constants are renamed back in index.js.
Future work:
Probably move all of these "exact" APIs off into a separate silo you can import using require('t-a-i/exact')
Rename Rat to Exact? Not all existing Rats represent instants in time, though. I need to think about this a little.
Converter
's methodsunixToAtomic
andatomicToUnix
are renamed tounixMillisToAtomicMillis
andatomicMillisToUnixMillis
respectively. New methodsunixToAtomic
andatomicToUnix
are introduced; these perform exact calculations onRat
s.unixMillisToAtomicMillis
andatomicMillisToUnixMillis
now call out to these.index.js
.open: true
or just omit that flag entirely.Converter
's unit tests to test the newunixToAtomic
andatomicToUnix
methods, and to be much more exhaustive testing time conversions around points of interest.gcd
's behaviour is no longer to always return a GCD with the same sign asb
. It's nowRat
's job to do that sign conversion.millisToExact
is nowRat.fromMillis
, a static method.exactToMillis
is nowRat.prototype.toMillis
.munge
has been modified slightly to account for the possibility of zero-length segments between two smears, specifically between two stalls.Rat.prototype.cmp
and eliminate it. Just subtract. The "numerator sign is authoritative" property makes this much easier.tai-data.js
's exportsUNIX_START
andUNIX_END
are been renamed toUNIX_START_MILLIS
andUNIX_END_MILLIS
respectively. New exportsUNIX_START
andUNIX_END
are introduced; these areRat
s.index.js
.Future work:
require('t-a-i/exact')
Rat
toExact
? Not all existingRat
s represent instants in time, though. I need to think about this a little.