MCPcopy Create free account
hub / github.com/cockroachdb/apd / RoundToIntegralValue

Method RoundToIntegralValue

context.go:1237–1244  ·  view source on GitHub ↗

RoundToIntegralValue sets d to integral value of x. Inexact and Rounded flags are ignored and removed.

(d, x *Decimal)

Source from the content-addressed store, hash-verified

1235// RoundToIntegralValue sets d to integral value of x. Inexact and Rounded flags
1236// are ignored and removed.
1237func (c *Context) RoundToIntegralValue(d, x *Decimal) (Condition, error) {
1238 if set, res, err := c.toIntegralSpecials(d, x); set {
1239 return res, err
1240 }
1241 res := c.toIntegral(d, x)
1242 res &= ^(Inexact | Rounded)
1243 return c.goError(res)
1244}
1245
1246// RoundToIntegralExact sets d to integral value of x.
1247func (c *Context) RoundToIntegralExact(d, x *Decimal) (Condition, error) {

Callers 1

RunMethod · 0.45

Calls 3

toIntegralSpecialsMethod · 0.95
toIntegralMethod · 0.95
goErrorMethod · 0.95

Tested by 1

RunMethod · 0.36