4 Temperatures
(require typed/measures-with-dimensions/temperature) | |
package: measures-with-dimensions |
procedure
(celsius n) → Absolute-Temperature
n : Real
procedure
n : Real
> (require typed/racket)
> (require typed/measures-with-dimensions)
> (fahrenheit 32.0) - : Absolute-Temperature
(m: 491.67 rankine)
> (fahrenheit 212.0) - : Absolute-Temperature
(m: 671.6700000000001 rankine)
> (fahrenheit 0.0) - : Absolute-Temperature
(m: 459.67 rankine)
> (fahrenheit -459.67) - : Absolute-Temperature
(m: 0.0 rankine)
procedure
(get-kelvin m) → Nonnegative-Real
m : Absolute-Temperature
> (require typed/racket)
> (require typed/measures-with-dimensions)
> (get-kelvin (make-measure 300 kelvin)) - : Real [more precisely: Nonnegative-Real]
300
> (get-kelvin (celsius 0.0)) - : Real [more precisely: Nonnegative-Real]
273.15
> (get-kelvin (celsius 100.0)) - : Real [more precisely: Nonnegative-Real]
373.15
> (get-kelvin (fahrenheit 32.0)) - : Real [more precisely: Nonnegative-Real]
273.15000000000003
procedure
(get-rankine m) → Nonnegative-Real
m : Absolute-Temperature
> (require typed/racket)
> (require typed/measures-with-dimensions)
> (get-rankine (make-measure 500 rankine)) - : Real [more precisely: Nonnegative-Real]
500
> (get-rankine (celsius 0.0)) - : Real [more precisely: Nonnegative-Real]
491.66999999999996
> (get-rankine (fahrenheit 32.0)) - : Real [more precisely: Nonnegative-Real]
491.67
> (get-rankine (fahrenheit 212.0)) - : Real [more precisely: Nonnegative-Real]
671.6700000000001
procedure
(get-celsius m) → Real
m : Absolute-Temperature
> (require typed/racket)
> (require typed/measures-with-dimensions)
> (get-celsius (make-measure 273.15 kelvin)) - : Real
0.0
> (get-celsius (celsius 0)) - : Real
0
> (get-celsius (fahrenheit 32)) - : Real
0
> (get-celsius (fahrenheit 212)) - : Real
100
procedure
(get-fahrenheit m) → Real
m : Absolute-Temperature
> (require typed/racket)
> (require typed/measures-with-dimensions)
> (get-fahrenheit (make-measure 273.15 kelvin)) - : Real
31.999999999999943
> (get-fahrenheit (fahrenheit 32)) - : Real
32
> (get-fahrenheit (celsius 0)) - : Real
32
> (get-fahrenheit (celsius 100)) - : Real
212