4 ms·
I'll wrap up a new version of the library that's independent of what I have it hooked up to and upload it to npm and hex.pm respectively. When I first wrote it
by strmpnk 11y ago
I'll wrap up a new version of the library that's independent of what I have it hooked up to and upload it to npm and hex.pm respectively.
When I first wrote it, I started with midpoints but it doesn't take long to see that it gets messy to optimize. I eventually stumbled on the b-tree representation of all positive rational numbers (Stern-Brocot) and the optimization became obvious.