Skip to content

Commit 482aae2

Browse files
author
Milan K
authored
Update README.md
1 parent 693ecd4 commit 482aae2

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,36 @@
77
Finally a number type that you can count with your fingers. Super Mario and Zelda would be proud.
88

99
Comes in two flavours: `Float8` has 3 exponent bits and 4 fraction bits, `Float8_4` has 4 exponent bits and 3 fraction bits.
10-
Both rely on conversion to Float32 to perform any arithmetic operation.
10+
Both rely on conversion to Float32 to perform any arithmetic operation, similar to `Float16`.
11+
12+
# Example use
13+
14+
```julia
15+
julia> using .Float8s
16+
17+
julia> a = Float8(4)
18+
Float8(0x50)
19+
20+
julia> b = Float8(2)
21+
Float8(0x40)
22+
23+
julia> a+b
24+
Float8(0x58)
25+
26+
julia> Float32(a+b)
27+
6.0f0
28+
29+
julia> Float32(sqrt(a))
30+
2.0f0
31+
```
32+
Most arithmetic operations are implemented. If you would like to have an additional feature, raise an [issue](https://github.com/milankl/Float8s.jl/issues).
33+
34+
# Installation
35+
36+
`Float8s.jl` is not yet registered, for the time being do
37+
```julia
38+
(v1.3) pkg> add https://github.com/milankl/Float8s.jl
39+
```
1140

1241
# Benchmarking
1342
```julia

0 commit comments

Comments
 (0)