Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

782 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

floats

Go Reference test

The floats package provides types for handling multi-precision floating-point numbers.

SUPPORTED TYPES

Supported types are:

SYNOPSIS

package main

import (
  "fmt"

  "github.com/shogo82148/floats"
)

func main() {
  a := floats.NewFloat16(1.0)
  b := floats.NewFloat16(2.0)
  fmt.Printf("%g + %g = %g\n", a, b, a.Add(b))
  fmt.Printf("%g - %g = %g\n", a, b, a.Sub(b))
  fmt.Printf("%g * %g = %g\n", a, b, a.Mul(b))
  fmt.Printf("%g / %g = %g\n", a, b, a.Quo(b))
}

CORRECTNESS

The package passes tests generated by Berkeley TestFloat.

NOTICE

Some code has been developed with reference to Go's standard library and chewxy/math32. Please refer to the NOTICE for the copyright information of these libraries.

About

The floats package provides types for handling multi-precision floating-point numbers.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages