mirror of
https://github.com/shopspring/decimal.git
synced 2024-11-22 20:40:48 +01:00
Added negative pow test
This commit is contained in:
parent
4b9150b187
commit
3526cd0bdb
1 changed files with 9 additions and 0 deletions
|
@ -1371,6 +1371,15 @@ func TestPow(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestNegativePow(t *testing.T) {
|
||||||
|
a := New(4, 0)
|
||||||
|
b := New(-2, 0)
|
||||||
|
x := a.Pow(b)
|
||||||
|
if x.String() != "0.0625" {
|
||||||
|
t.Errorf("Error, saw %s", x.String())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestDecimal_Sign(t *testing.T) {
|
func TestDecimal_Sign(t *testing.T) {
|
||||||
if Zero.Sign() != 0 {
|
if Zero.Sign() != 0 {
|
||||||
t.Errorf("%q should have sign 0", Zero)
|
t.Errorf("%q should have sign 0", Zero)
|
||||||
|
|
Loading…
Reference in a new issue