Skip to content

.pow() and .root() functions for fraction types #60

@Gip-Gip

Description

@Gip-Gip

I'm currently writing a basic calculator with this library and I noticed at the moment there is no .pow() or .root() style functions for fractions.

Also when performing square roots should they simply be approximated or should numbers simply represent simplified square roots, popping all of the irrational roots in a vector or something like that. For example, something like this

let foo = Fraction::from(75u32);
let result = foo.sqrt();
assert_eq!(5, result.get_base_multiplicand()); // Not actually functional code just here to get a point across
assert_eq!(3, result.get_root_multipliers()[0]);
println!("{:9}", result); // -> 8.660254037

I would like to contribute I'm just unsure how as to go about tackling this problem, at the moment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions