Module math.fractions stdlib

math.fractions
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
2
Imported by:
0
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

This section is empty.

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

#fn approximate

fn approximate(val f64) Fraction

approximate returns a Fraction that approcimates the given value to within the default epsilon value (1.0e-4). This means the result will be accurate to 3 places after the decimal.

#fn approximate_with_eps

fn approximate_with_eps(val f64, eps f64) Fraction

approximate_with_eps returns a Fraction

#fn fraction

fn fraction(n i64, d i64) Fraction

A factory function for creating a Fraction, adds a boundary condition to ensure that the denominator is non-zero. It automatically converts the negative denominator to positive and adjusts the numerator.

NOTE: Fractions created are not reduced by default.

Structs

This section is empty.

Interfaces

This section is empty.

Enums

This section is empty.