num-rational
num-rational copied to clipboard
Generic Rational numbers for Rust
These should be easy to implement. I created some implementations, but I don't want to check, which of them should be functions, methods or trait implementations. I made all of...
`Ratio`'s implementation of `ToPrimitive` methods currently looks like this: ```rust fn to_u64(&self) -> Option { self.to_integer().to_u64() } ``` But the documentation for `to_u64` in the `ToPrimitive` trait states (emphasis added):...
Python's `fractions` module in the standard library implements a rational type and provides a really handy `limit_denominator` method. I've implemented it here along with some tests. This PR should address...
I propose to add a trait to explicitly allow rational approximation for various types. This is motivated by my crate for irrational numbers where I would like to have a...
_From @rust-highfive on September 28, 2014 22:43_ **Issue by [klutzy](https://github.com/klutzy)** _Wednesday Aug 27, 2014 at 07:50 GMT_ _For earlier discussion, see https://github.com/rust-lang/rust/issues/16782_ _This issue was labelled with: in the Rust...
_From @joshlf on December 21, 2017 20:10_ `Ratio`'s `Display` implementation formats as a fraction (e.g., `17/42`). It would be useful if there were a way to format instead as a...
Related to https://github.com/rust-num/num-bigint/issues/55 Should it be implemented on top of BigInts or some better approach is possible? > Ratio will be trickier to deal with precision, because you probably don't...
This crate makes use of features so that "you don't pay for what you don't use" and to support no_std while allowing for extensions that require the standard library. This...
I'm using this library to losslessly model orbits in an n-body simulator, and I've noticed that after just a few iterations, the length of the data field seems to be...
What could be causing the below? I have not been able to figure if there is another crate with same name. `use num_bigint::{BigUint, BigInt};` `use num_rational::BigRational;` ```--> src/main.rs:38:45 | 38...