MCPcopy Create free account
hub / github.com/Shopify/go-lua / TestUnsigned

Function TestUnsigned

go_test.go:74–89  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

72}
73
74func TestUnsigned(t *testing.T) {
75 n := -1.0
76 const supUnsigned = float64(^uint32(0)) + 1
77 if x := math.Floor(n / supUnsigned); x != -1.0 {
78 t.Error("math.Floor(-1/supUnsigned) == ", x)
79 }
80 if x := math.Floor(n/supUnsigned) * supUnsigned; x != -4294967296.0 {
81 t.Error("math.Floor(n/supUnsigned)*supUnsigned == ", x)
82 }
83 if x := n - math.Floor(n/supUnsigned)*supUnsigned; x != 4294967295.0 {
84 t.Error("n-math.Floor(n/supUnsigned)*supUnsigned == ", x)
85 }
86 if x := uint(n - math.Floor(n/supUnsigned)*supUnsigned); x != 4294967295 {
87 t.Error("uint(n-math.Floor(n/supUnsigned)*supUnsigned) == ", x)
88 }
89}

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…