dnsl48 / fraction

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

Is there a list of methods that floats have that aren't impled for fractions #87

Open DrAlta opened 1 year ago

DrAlta commented 1 year ago

I know about power and root function mentioned in https://github.com/dnsl48/fraction/issues/60

but are there any others?

I'm working on something, at least for my own personal use until we come up with an official solution. I haven't worked out all the details yet so won't go into them here.

dnsl48 commented 1 year ago

Hey @DrAlta,

Here is the num trait which declares the Float contract: https://docs.rs/num/latest/num/trait.Float.html We don't keep a list, but if you add impl Float for GenericFraction in your local codebase, rustc should give you the list of all missing methods.

DrAlta commented 1 year ago

GenericFraction doesn't impl NumCast which is a requirement for Float You have to wrap them in the Float trait so it just lists the mall not only the missing ones.