dnsl48 / fraction

[Rust] Lossless fractions and decimals; drop-in float replacement
Apache License 2.0
83 stars 25 forks source link

Add a simplify function to fraction type #113

Closed pirsonxyz closed 1 month ago

pirsonxyz commented 1 month ago

This is useful when dealing with big fractions that can be simplified

dnsl48 commented 1 month ago

Hi @pirsonxyz, all fractions are simplified by default in the constructor, unless you are using GenericFraction::new_raw method, which primary discrepancy is the lack of simplification for performance reasons. Thus, you could use the GenericFraction::new constructor as the way to simplify a fraction.