qntm / t-a-i

Converts Unix milliseconds to and from International Atomic Time (TAI) milliseconds
MIT License
43 stars 2 forks source link

Use precise ratios exclusively inside of `Segment` #32

Closed qntm closed 2 years ago

qntm commented 2 years ago

This is part of a series of operations intended to make t-a-i better support JavaScript's forthcoming Temporal API, which somewhat resembles t-a-i's, but (among other things) deals with nanoseconds, where we deal with milliseconds in the external API and picoseconds in our internals. Ultimately I hope to expose APIs where you can submit any precise ratio of BigInts and receive a converted ratio in response - which you can then truncate to any degree of precision you wish, be it millisecond, microsecond, nanosecond or picosecond. It will then be possible to implement Temporal APIs around this. I hope. In any case these initial changes are for the simpler...