cockroachdb / cockroachdb/apd

Text('f'): 0 x 100 = 000

Open
#136 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
805
Forks
48
PR merge metrics
No merged PRs in 30d

Description

When multiplying 0 with some number, the resulting Text('f') shows too many zeroes. I expect the result to return "0"

```
x := new(apd.Decimal)
_, _ = x.SetFloat64(0)

multiplier := new(apd.Decimal)
_, _ = multiplier.SetFloat64(100)

result := new(apd.Decimal)
_, _ = apd.BaseContext.Mul(result, x, multiplier)

fmt.Println(result.Text('f')) // 000
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.