MCPcopy
hub / github.com/shopspring/decimal / BenchmarkDecimal_Sub_different_precision

Function BenchmarkDecimal_Sub_different_precision

decimal_bench_test.go:174–183  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

172}
173
174func BenchmarkDecimal_Sub_different_precision(b *testing.B) {
175 d1 := NewFromFloat(1000.123)
176 d2 := NewFromFloat(500).Mul(NewFromFloat(0.12))
177
178 b.ReportAllocs()
179 b.StartTimer()
180 for i := 0; i < b.N; i++ {
181 d1.Sub(d2)
182 }
183}
184
185func BenchmarkDecimal_Add_same_precision(b *testing.B) {
186 d1 := NewFromFloat(1000.123)

Callers

nothing calls this directly

Calls 3

NewFromFloatFunction · 0.85
MulMethod · 0.80
SubMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…