Skip to content

Commit 593f352

Browse files
committed
readme update
1 parent d5b9161 commit 593f352

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ After installation, you can import ieee754 and use it in your projects.
2626

2727
### Simplest Example
2828

29-
The simplest example is to use the desired precision IEEE-754 representation of a floating point number. You can import the desired precision from ieee754 and use it like this. The available precisions are half, single, double, quadruple and octuple.
29+
The simplest example is to use the desired precision IEEE-754 representation of a floating point number. You can import the desired precision from ieee754 and use it like this. The available precisions are `half`, `single`, `double`, `quadruple` and `octuple`.
3030
```Python
3131
from ieee754 import double
3232

@@ -78,12 +78,21 @@ print(octuple(x))
7878

7979
### Using a Custom Precision
8080

81-
You can force exponent, and mantissa size by using force_exponent and force_mantissa parameters to create your own custom precision.
81+
You can force exponent, and mantissa size by using `force_exponent` and `force_mantissa` parameters to create your own custom precision.
8282
```Python
8383
a = IEEE754(x, force_exponent=6, force_mantissa=12)
8484
print(a)
8585
```
8686

87+
### Finding the Error of a Floating Point Number
88+
89+
You can find the error of a floating point number by using the `converted_number` and `error` properties of the class.
90+
```Python
91+
x = 8.7
92+
a = IEEE754(x, 1)
93+
print(f"{x} is converted as {a.converted_number} ± {a.error}")
94+
```
95+
8796

8897

8998
License

0 commit comments

Comments
 (0)