Skip to content

Commit 2ed8362

Browse files
committed
readme update
1 parent 8bf8d11 commit 2ed8362

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

README.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ x = Fxp(-7.25) # create fxp variable with value 7.25
4747
x.info()
4848
```
4949

50-
> dtype = fxp-s6/2
51-
> Value = -7.25
50+
> dtype = fxp-s6/2
51+
> Value = -7.25
5252
5353
We have created a variable of 6 bits, where 1 bit has been reserved for sign, 2 bits for fractional part, and 3 remains for integer part. Here, bit sizes had been calculated to just satisfy the value you want to save.
5454

@@ -76,21 +76,21 @@ You can print more information only changing the verbosity of *info* method.
7676
x.info(verbose=3)
7777
```
7878

79-
> dtype = fxp-s16/8
80-
> Value = -7.25
79+
> dtype = fxp-s16/8
80+
> Value = -7.25
8181
>
82-
> Signed = True
83-
> Word bits = 16
84-
> Fract bits = 8
85-
> Int bits = 7
86-
> Val data type = float64
82+
> Signed = True
83+
> Word bits = 16
84+
> Fract bits = 8
85+
> Int bits = 7
86+
> Val data type = float64
8787
>
88-
> Upper = 127.99609375
89-
> Lower = -128.0
90-
> Precision = 0.00390625
91-
> Overflow = saturate
92-
> Rounfing = trunc
93-
> Shifting = expand
88+
> Upper = 127.99609375
89+
> Lower = -128.0
90+
> Precision = 0.00390625
91+
> Overflow = saturate
92+
> Rounfing = trunc
93+
> Shifting = expand
9494
9595
### Representations
9696

@@ -100,14 +100,14 @@ We can representate the value stored en `x` in several ways:
100100
x
101101
```
102102

103-
> -7.25
103+
> -7.25
104104
105105
```python
106106
x.get_val() # return a Numpy array with the val/values in original data type representation
107107
x() # equivalent to x.get_val() or x.astype(self.vdtype)
108108
```
109109

110-
> -7.25
110+
> -7.25
111111
112112
In different bases:
113113

@@ -120,9 +120,9 @@ x.base_repr(16) # hex with sign symbol (not complement)
120120
```
121121

122122
> '1111100011000000'
123-
> '11111000.11000000'
124-
> '-11101000000'
125-
> '0xf8c0'
123+
> '11111000.11000000'
124+
> '-11101000000'
125+
> '0xf8c0'
126126
> '-740'
127127
128128

@@ -458,21 +458,21 @@ x = Fxp(10128.5, signed=False, n_word=12, scale=1, bias=10000)
458458
x.info(3)
459459
```
460460

461-
> dtype = fxp-u12/1
462-
> Value = 10128.5
463-
> Scaling = 1 * val + 10000
461+
> dtype = fxp-u12/1
462+
> Value = 10128.5
463+
> Scaling = 1 * val + 10000
464464
>
465-
> Signed = False
466-
> Word bits = 12
467-
> Fract bits = 1
468-
> Int bits = 11
469-
> Val data type = float64
465+
> Signed = False
466+
> Word bits = 12
467+
> Fract bits = 1
468+
> Int bits = 11
469+
> Val data type = float64
470470
>
471-
> Upper = 12047.5
472-
> Lower = 10000.0
473-
> Precision = 0.5
474-
> Overflow = saturate
475-
> Rounfing = trunc
476-
> Shifting = expand
471+
> Upper = 12047.5
472+
> Lower = 10000.0
473+
> Precision = 0.5
474+
> Overflow = saturate
475+
> Rounfing = trunc
476+
> Shifting = expand
477477
478478
Note de *upper* and *lower* limits are correct, and that the *precision* is what we needed.

0 commit comments

Comments
 (0)