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

Method Sign

decimal.go:1359–1364  ·  view source on GitHub ↗

Sign returns: -1 if d < 0 0 if d == 0 +1 if d > 0

()

Source from the content-addressed store, hash-verified

1357// 0 if d == 0
1358// +1 if d > 0
1359func (d Decimal) Sign() int {
1360 if d.value == nil {
1361 return 0
1362 }
1363 return d.value.Sign()
1364}
1365
1366// IsPositive return
1367//

Callers 15

PowMethod · 0.95
PowWithPrecisionMethod · 0.95
ExpTaylorMethod · 0.95
IsPositiveMethod · 0.95
IsNegativeMethod · 0.95
IsZeroMethod · 0.95
TestDecimal_QuoRemFunction · 0.80
TestDecimal_QuoRem2Function · 0.80
signFunction · 0.80
TestDecimal_SignFunction · 0.80
QuoRemMethod · 0.80

Calls

no outgoing calls

Tested by 5

TestDecimal_QuoRemFunction · 0.64
TestDecimal_QuoRem2Function · 0.64
signFunction · 0.64
TestDecimal_SignFunction · 0.64