tempconv

package
v0.0.0-...-69de378 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package tempconv performs Celsius, Fahrenheit and Kelvin conversions.

Index

Constants

View Source
const (
	AbsoluteZeroC Celsius    = -273.15
	FreezingK     Kelvin     = 273.15
	FreezingC     Celsius    = 0
	FreezingF     Fahrenheit = 32
	BoilingK      Kelvin     = 373.15
	BoilingC      Celsius    = 100
	BoilingF      Fahrenheit = 212
)

Some well known constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Celsius

type Celsius float64

Celsius is a dedicated type for a temperature in Celsius degrees

func FToC

func FToC(f Fahrenheit) Celsius

FToC converts a Fahrenheit temperature to Celsius.

func KToC

func KToC(k Kelvin) Celsius

KToC converts a Kelvin temperature to Celsius.

func (Celsius) String

func (c Celsius) String() string

Format a Celsius temperature

type Fahrenheit

type Fahrenheit float64

Fahrenheit is a dedicated type for a temperature in Fahrenheit degrees

func CToF

func CToF(c Celsius) Fahrenheit

CToF converts a Celsius temperature to Fahrenheit.

func KToF

func KToF(k Kelvin) Fahrenheit

KToF converts a Kelvin temperature to Fahrenheit.

func (Fahrenheit) String

func (f Fahrenheit) String() string

Format a Fahrenheit temperature

type Kelvin

type Kelvin float64

Kelvin is a dedicated type for a temperature in Kelvin degrees

func CToK

func CToK(c Celsius) Kelvin

CToK converts a Celsius temperature to Kelvin.

func FToK

func FToK(f Fahrenheit) Kelvin

FToK converts a Fahrenheit temperature to Kelvin.

func (Kelvin) String

func (k Kelvin) String() string

Format a Kelvin temperature

Jump to

Keyboard shortcuts

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