cmpute / dashu

A library set of arbitrary precision numbers implemented in Rust.
Apache License 2.0
74 stars 9 forks source link

To reuse `num-rational` or not #5

Closed lemmih closed 1 year ago

lemmih commented 1 year ago

Hi Jacob,

What are your plans regarding dashu-rational? Do you want to implement Ratio in dashu or reuse the one in num-rational?

Advantages of a re-write:

Disadvantages of a re-write:

cmpute commented 1 year ago

Hi David, thanks for your interest. My current plan will be to implement num_integer::Integer for dashu_int::UBig/IBig first, so that they can be used as the base types for num_rational::Ratio, which should be fairly easy. Then I'm going to implement dashu_rational from scratch, because it's relatively easy to implement the rational library.

Specifically, I'm planning to implement two types of rational numbers. One is a rational number with numerator and denominator always normalized (with GCD ripped off), the other is a number without normalization forced during operations, because GCD is the costliest step for rational numbers.

cmpute commented 1 year ago

num_integer::Integer is implemented for UBig/IBig in version 0.2.1, so it can be used with num-rational. I'm going to implement a rational number library in the next big release. Close it for now, if you met any problems with num-rational + IBig, please create new issues.

cmpute commented 1 year ago

v0.3 has been published and it contains a library for rational numbers. Feel free to have a look and any feedback are welcome!