Skip to content

Commit 5e3c367

Browse files
committed
Add solution for GC8JHR8
1 parent 817ec0a commit 5e3c367

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

gc8jhr8_small_fuzzy_numbers/main.go

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/d4l3k/go-bfloat16"
7+
)
8+
9+
var floats = []float32{
10+
7.112e-37,
11+
5.031e-05,
12+
5.049e-28,
13+
3.964e-06,
14+
}
15+
16+
func main() {
17+
for _, f := range floats {
18+
fmt.Printf("%x\n", bfloat16.FromFloat32(f))
19+
20+
}
21+
}

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ require github.com/keep94/sqroot/v3 v3.7.2
66

77
require (
88
github.com/bitlux/vpnapi v0.0.0-20250207215125-f066bb2314a4 // indirect
9+
github.com/d4l3k/go-bfloat16 v0.0.0-20211005043715-690c3bdd05f1 // indirect
910
github.com/keep94/consume2 v0.7.0 // indirect
1011
)

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
github.com/bitlux/vpnapi v0.0.0-20250207215125-f066bb2314a4 h1:zYVWlKFsyl3tMu3Ak9es+EMW2DUe9nqPQaOQNBtu2XQ=
22
github.com/bitlux/vpnapi v0.0.0-20250207215125-f066bb2314a4/go.mod h1:ou6ccQPRIv8uzPNeLaRLxnwd2felkT30fwGnJtbVYCg=
3+
github.com/d4l3k/go-bfloat16 v0.0.0-20211005043715-690c3bdd05f1 h1:cBzrdJPAFBsgCrDPnZxlp1dF2+k4r1kVpD7+1S1PVjY=
4+
github.com/d4l3k/go-bfloat16 v0.0.0-20211005043715-690c3bdd05f1/go.mod h1:uw2gLcxEuYUlAd/EXyjc/v55nd3+47YAgWbSXVxPrNI=
35
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
46
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
57
github.com/keep94/consume2 v0.7.0 h1:JbS/XxmPbHgEG+1pvGEGc192nCOEx+S/DmJBZz9fkvQ=

0 commit comments

Comments
 (0)