astifloat

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rational

type Rational struct {
	// contains filtered or unexported fields
}

Rational represents a rational

func NewRational added in v1.1.0

func NewRational(num, den int) *Rational

NewRational creates a new rational

func (*Rational) Den

func (r *Rational) Den() int

Den returns the rational den

func (*Rational) MarshalText added in v1.1.0

func (r *Rational) MarshalText() (b []byte, err error)

MarshalText implements the TextMarshaler interface

func (*Rational) Num

func (r *Rational) Num() int

Num returns the rational num

func (*Rational) ToFloat64 added in v1.1.0

func (r *Rational) ToFloat64() float64

ToFloat64 returns the rational as a float64

func (*Rational) UnmarshalText

func (r *Rational) UnmarshalText(b []byte) (err error)

UnmarshalText implements the TextUnmarshaler interface

Jump to

Keyboard shortcuts

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