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

Method RoundToIntegralExact

context.go:1247–1253  ·  view source on GitHub ↗

RoundToIntegralExact sets d to integral value of x.

(d, x *Decimal)

Source from the content-addressed store, hash-verified

1245
1246// RoundToIntegralExact sets d to integral value of x.
1247func (c *Context) RoundToIntegralExact(d, x *Decimal) (Condition, error) {
1248 if set, res, err := c.toIntegralSpecials(d, x); set {
1249 return res, err
1250 }
1251 res := c.toIntegral(d, x)
1252 return c.goError(res)
1253}
1254
1255// Ceil sets d to the smallest integer >= x.
1256func (c *Context) Ceil(d, x *Decimal) (Condition, error) {

Callers 2

RunMethod · 0.45

Calls 3

toIntegralSpecialsMethod · 0.95
toIntegralMethod · 0.95
goErrorMethod · 0.95

Tested by 2

RunMethod · 0.36