[][src]Function reikna::continued_fraction::expand_fraction

pub fn expand_fraction(fraction: &ContinuedFraction) -> (u64, u64)

Expand the continued fraction fraction one time, storing the result as a fraction in a double tuple of u64.

This is a helper function that calls expand_fraction_ntimes() with n = 1. See the documentation for expand_fraction_ntimes() for more information.

Panics

Panics if expand_fraction_ntimes() panics.

Examples

use reikna::continued_fraction::expand_fraction;
assert_eq!(expand_fraction(&vec![2, 1]), (5, 2));
assert_eq!(expand_fraction(&vec![3]), (3, 1));