Skip to content

Commit 6cfa339

Browse files
camgraffiwysiu
authored andcommitted
GODRIVER-1783 make primitive.Decimal128 implement Zeroer (#532)
1 parent c1b283e commit 6cfa339

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bson/primitive/decimal.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ func (d Decimal128) IsInf() int {
206206
return -1
207207
}
208208

209+
// IsZero returns true if d is the empty Decimal128.
210+
func (d Decimal128) IsZero() bool {
211+
return d.h == 0 && d.l == 0
212+
}
213+
209214
func divmod(h, l uint64, div uint32) (qh, ql uint64, rem uint32) {
210215
div64 := uint64(div)
211216
a := h >> 32

0 commit comments

Comments
 (0)