OpenTimelineIO icon indicating copy to clipboard operation
OpenTimelineIO copied to clipboard

decimal - binary - string round tripping

Open meshula opened this issue 3 years ago • 1 comments
trafficstars

Feature Request

Use our own decimal/binary and binary/decimal conversion routines for representing time values in strings, instead of relying on each language's standard library, in order to guarantee round trip lossless conversions

Description

it should be the case that any number of iterations of binary_num -> decimal string -> binary_num should result in identical values forever. It occurred to me that if we adopted an algorithm like dragonbox, we could guarantee round tripping, irrespective of what a language's standard runtime is doing. https://github.com/abolz/Drachennest

I'm suggesting dragonbox specifically because not only is it the fastest on the benchmark, it makes explicit round-trip guarantees. https://github.com/jk-jeon/dragonbox

Context

This issue comes up whenever we revisit the formatting strings we use in conversion, our options are usually severely constrained on formatting that works losslessly across conversion in Python and C++.

meshula avatar Dec 11 '21 01:12 meshula

https://github.com/PixarAnimationStudios/OpenTimelineIO/issues/682

meshula avatar Dec 11 '21 04:12 meshula