Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xyproto/num

Fractions and conversion to/from string, float64 and big numbers
https://github.com/xyproto/num

conversions denominator fractions mathematics numerator

Last synced: 20 days ago
JSON representation

Fractions and conversion to/from string, float64 and big numbers

Awesome Lists containing this project

README

        

# num

[![GoDoc](https://godoc.org/github.com/xyproto/num?status.svg)](http://godoc.org/github.com/xyproto/num)

Go module for dealing with fractions, and a utility for dividing two numbers and returning the simplified fraction.

## Example use

> frac 2/5

> frac 0.8

> frac 123
123

Use only 100 iterations when creating a fraction that represents the given float:

> frac -m 100 0.777777777
10/13

## Installation

go install github.com/xyproto/num/cmd/frac@latest

## General info

* License: BSD-3