fraction

package
v1.0.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Component

func Component[T constraints.Float](n T) int

func Magnitude

func Magnitude[T constraints.Float](n T) int

Types

type Fraction

type Fraction struct {
	Numerator   int
	Denominator int
}

func FromFloat

func FromFloat[T constraints.Float](n T) Fraction

func New

func New(numerator, denominator int) Fraction

func (Fraction) Copy

func (t Fraction) Copy() Fraction

func (Fraction) Float

func (t Fraction) Float() float64

func (Fraction) Reduce

func (t Fraction) Reduce() Fraction

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL