Skip to content

google/go-units

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Go Units

Go Reference Go Build and Test

This Go library represents physical units like length, area, speed, and temperature as typed floating point numbers. Methods to convert between metric and US customary units of measurement are provided on each type. Additional units can be created by multiplying by const values and variables can be converted by casting. See this example snippet for the exact syntax.

Unit types are represented as a float64 in the base SI measure: meters, square meters, meters per second, and Kelvin. Working with very large or very small values relative to the base SI unit will lose some precision: the distance from the Sun to Alpha Centauri in meters is near the precision limit of 64-bit floating point numbers, and the distance to the edge of universe cannot be represented as a unit.Length. Likewise, subatomic measurements will not be precise.

This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.

About

Go library for physical unit conversions

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages