replace native.Float/native.Double with native.Float32/native.Float64
This commit is contained in:
parent
21bb33193a
commit
bce52e9fcf
3 changed files with 38 additions and 38 deletions
morphisms
|
@ -2,32 +2,32 @@
|
|||
```
|
||||
|
||||
morph_celsius_to_kelvin ()
|
||||
Temperature ~ Celsius ~ ℝ ~ native.Float
|
||||
--> Temperature ~ Kelvin ~ ℝ ~ native.Float
|
||||
Temperature ~ Celsius ~ ℝ ~ native.Float32
|
||||
--> Temperature ~ Kelvin ~ ℝ ~ native.Float32
|
||||
```
|
||||
*dst = *src + 273.15;
|
||||
return 0;
|
||||
```
|
||||
|
||||
morph_kelvin_to_celsius ()
|
||||
Temperature ~ Kelvin ~ ℝ ~ native.Float
|
||||
--> Temperature ~ Celsius ~ ℝ ~ native.Float
|
||||
Temperature ~ Kelvin ~ ℝ ~ native.Float32
|
||||
--> Temperature ~ Celsius ~ ℝ ~ native.Float32
|
||||
```
|
||||
*dst = *src - 273.15;
|
||||
return 0;
|
||||
```
|
||||
|
||||
morph_celsius_to_fahrenheit ()
|
||||
Temperature ~ Celsius ~ ℝ ~ native.Float
|
||||
--> Temperature ~ Fahrenheit ~ ℝ ~ native.Float
|
||||
Temperature ~ Celsius ~ ℝ ~ native.Float32
|
||||
--> Temperature ~ Fahrenheit ~ ℝ ~ native.Float32
|
||||
```
|
||||
*dst = (*src * 9.0 / 5.0) + 32.0;
|
||||
return 0;
|
||||
```
|
||||
|
||||
morph_fahrenheit_to_celsius ()
|
||||
Temperature ~ Fahrenheit ~ ℝ ~ native.Float
|
||||
--> Temperature ~ Celsius ~ ℝ ~ native.Float
|
||||
Temperature ~ Fahrenheit ~ ℝ ~ native.Float32
|
||||
--> Temperature ~ Celsius ~ ℝ ~ native.Float32
|
||||
```
|
||||
*dst = (*src - 32.0) * 5.0 / 9.0;
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue