replace x86.T with native.T
This commit is contained in:
parent
e29a5a3475
commit
f67f8c0118
12 changed files with 91 additions and 91 deletions
morphisms
|
@ -3,7 +3,7 @@
|
|||
```
|
||||
|
||||
morph_real_as_decimalstr_to_float ()
|
||||
ℝ ~ <PosInt 10 BigEndian> ~ <Seq~<ValueTerminated 0> <Digit 10>~Char~Ascii~x86.UInt8>
|
||||
ℝ ~ <PosInt 10 BigEndian> ~ <Seq~<ValueTerminated 0> <Digit 10>~Char~Ascii~native.UInt8>
|
||||
--> ℝ ~ native.Float
|
||||
```
|
||||
sscanf(src, "%f", dst);
|
||||
|
@ -11,7 +11,7 @@ morph_real_as_decimalstr_to_float ()
|
|||
```
|
||||
|
||||
morph_real_as_decimalstr_to_double ()
|
||||
ℝ ~ <PosInt 10 BigEndian> ~ <Seq~<ValueTerminated 0> <Digit 10>~Char~Ascii~x86.UInt8>
|
||||
ℝ ~ <PosInt 10 BigEndian> ~ <Seq~<ValueTerminated 0> <Digit 10>~Char~Ascii~native.UInt8>
|
||||
--> ℝ ~ native.Double
|
||||
```
|
||||
sscanf(src, "%lf", dst);
|
||||
|
@ -20,7 +20,7 @@ morph_real_as_decimalstr_to_double ()
|
|||
|
||||
morph_real_as_float_to_decimalstr ()
|
||||
ℝ ~ native.Float
|
||||
--> ℝ ~ <PosInt 10 BigEndian> ~ <Seq~<ValueTerminated 0> <Digit 10>~Char~Ascii~x86.UInt8>
|
||||
--> ℝ ~ <PosInt 10 BigEndian> ~ <Seq~<ValueTerminated 0> <Digit 10>~Char~Ascii~native.UInt8>
|
||||
```
|
||||
sprintf(dst, "%f", *src);
|
||||
return 0;
|
||||
|
@ -28,7 +28,7 @@ morph_real_as_float_to_decimalstr ()
|
|||
|
||||
morph_real_as_double_to_decimalstr ()
|
||||
ℝ ~ native.Double
|
||||
--> ℝ ~ <PosInt 10 BigEndian> ~ <Seq~<ValueTerminated 0> <Digit 10>~Char~Ascii~x86.UInt8>
|
||||
--> ℝ ~ <PosInt 10 BigEndian> ~ <Seq~<ValueTerminated 0> <Digit 10>~Char~Ascii~native.UInt8>
|
||||
```
|
||||
sprintf(dst, "%f", *src);
|
||||
return 0;
|
||||
|
@ -53,7 +53,7 @@ morph_real_as_double_to_float ()
|
|||
```
|
||||
|
||||
morph_real_as_u64_to_float ()
|
||||
ℝ ~ ℕ ~ x86.UInt64
|
||||
ℝ ~ ℕ ~ native.UInt64
|
||||
--> ℝ ~ native.Float
|
||||
```
|
||||
fprintf(stderr, "Warning: morphin UInt64 -> Float. Precision loss!");
|
||||
|
@ -62,7 +62,7 @@ morph_real_as_u64_to_float ()
|
|||
```
|
||||
|
||||
morph_real_as_u64_to_double ()
|
||||
ℝ ~ ℕ ~ x86.UInt64
|
||||
ℝ ~ ℕ ~ native.UInt64
|
||||
--> ℝ ~ native.Double
|
||||
```
|
||||
fprintf(stderr, "Warning: morphin UInt64 -> Double. Precision loss!");
|
||||
|
@ -71,7 +71,7 @@ morph_real_as_u64_to_double ()
|
|||
```
|
||||
|
||||
morph_real_as_quantized_linear_to_float (Begin: ℝ, End: ℝ, Steps: ℤ)
|
||||
ℝ ~ <QuantizedLinear Begin End Steps> ~ ℕ ~ x86.UInt64
|
||||
ℝ ~ <QuantizedLinear Begin End Steps> ~ ℕ ~ native.UInt64
|
||||
--> ℝ ~ native.Float
|
||||
```
|
||||
*dst = (float)Begin + ( *src * ((float)End - (float)Begin) ) / (float)Steps;
|
||||
|
@ -80,7 +80,7 @@ morph_real_as_quantized_linear_to_float (Begin: ℝ, End: ℝ, Steps: ℤ)
|
|||
|
||||
morph_real_as_float_to_quantized_linear (Begin: ℝ, End: ℝ, Steps: ℤ)
|
||||
ℝ ~ native.Float
|
||||
--> ℝ ~ <QuantizedLinear Begin End Steps> ~ ℕ ~ x86.UInt64
|
||||
--> ℝ ~ <QuantizedLinear Begin End Steps> ~ ℕ ~ native.UInt64
|
||||
```
|
||||
*dst = ((*src - (float)Begin) * (float)Steps) / ((float)End - (float)Begin);
|
||||
return 0;
|
||||
|
@ -89,7 +89,7 @@ morph_real_as_float_to_quantized_linear (Begin: ℝ, End: ℝ, Steps: ℤ)
|
|||
|
||||
|
||||
morph_real_as_quantized_linear_to_double (Begin: ℝ, End: ℝ, Steps: ℤ)
|
||||
ℝ ~ <QuantizedLinear Begin End Steps> ~ ℕ ~ x86.UInt64
|
||||
ℝ ~ <QuantizedLinear Begin End Steps> ~ ℕ ~ native.UInt64
|
||||
--> ℝ ~ native.Double
|
||||
```
|
||||
*dst = (double)Begin + ( *src * ((double)End - (double)Begin) ) / (double)Steps;
|
||||
|
@ -98,7 +98,7 @@ morph_real_as_quantized_linear_to_double (Begin: ℝ, End: ℝ, Steps: ℤ)
|
|||
|
||||
morph_real_as_double_to_quantized_linear (Begin: ℝ, End: ℝ, Steps: ℤ)
|
||||
ℝ ~ native.Double
|
||||
--> ℝ ~ <QuantizedLinear Begin End Steps> ~ ℕ ~ x86.UInt64
|
||||
--> ℝ ~ <QuantizedLinear Begin End Steps> ~ ℕ ~ native.UInt64
|
||||
```
|
||||
*dst = ((*src - (double)Begin) * (double)Steps) / ((double)End - (double)Begin);
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue