Documentation ¶
Index ¶
- func GCD(a, b int) int
- type Fraction
- func (fraction Fraction) Add(other Fraction) Fraction
- func (fraction Fraction) Divide(other Fraction) Fraction
- func (fraction Fraction) Equals(other Fraction) bool
- func (fraction Fraction) GreaterThan(other Fraction) bool
- func (fraction Fraction) Invert() Fraction
- func (fraction Fraction) IsZero() bool
- func (fraction Fraction) LessThan(other Fraction) bool
- func (fraction Fraction) LessThanEqual(other Fraction) bool
- func (fraction Fraction) Multiply(other Fraction) Fraction
- func (fraction Fraction) Negate() Fraction
- func (fraction Fraction) NormalString() string
- func (fraction Fraction) Reduce() Fraction
- func (fraction Fraction) String() string
- func (fraction Fraction) Subtract(other Fraction) Fraction
- func (fraction Fraction) ToFloat() float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fraction ¶
func (Fraction) GreaterThan ¶
func (Fraction) LessThanEqual ¶
func (Fraction) NormalString ¶
convert 3/2 into '1 1/2' 1/2 -> '1/2'
Click to show internal directories.
Click to hide internal directories.