34 lines
740 B
Text
34 lines
740 B
Text
```
|
||
```
|
||
|
||
morph_celsius_to_kelvin ()
|
||
Temperature ~ Celsius ~ ℝ ~ native.Float
|
||
--> Temperature ~ Kelvin ~ ℝ ~ native.Float
|
||
```
|
||
*dst = *src + 273.15;
|
||
return 0;
|
||
```
|
||
|
||
morph_kelvin_to_celsius ()
|
||
Temperature ~ Kelvin ~ ℝ ~ native.Float
|
||
--> Temperature ~ Celsius ~ ℝ ~ native.Float
|
||
```
|
||
*dst = *src - 273.15;
|
||
return 0;
|
||
```
|
||
|
||
morph_celsius_to_fahrenheit ()
|
||
Temperature ~ Celsius ~ ℝ ~ native.Float
|
||
--> Temperature ~ Fahrenheit ~ ℝ ~ native.Float
|
||
```
|
||
*dst = (*src * 9.0 / 5.0) + 32.0;
|
||
return 0;
|
||
```
|
||
|
||
morph_fahrenheit_to_celsius ()
|
||
Temperature ~ Fahrenheit ~ ℝ ~ native.Float
|
||
--> Temperature ~ Celsius ~ ℝ ~ native.Float
|
||
```
|
||
*dst = (*src - 32.0) * 5.0 / 9.0;
|
||
return 0;
|
||
```
|