You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bigfloat.Pow() function seems a little too restrictive relative to the math.Pow() standard library equivalent for negative bases with integer exponents (which are well-defined).
Thanks!
package main
import (
"fmt""math""math/big""github.com/ALTree/bigfloat"
)
funcmain() {
// Exponentiation of all negative bases is well defined for all // integer valued exponents. e.g. -2^-2 = 0.25quarter:=math.Pow(-2, -2)
fmt.Printf("%f\n", quarter) // 0.250000bigneg2:=big.NewFloat(-2)
bigquarter:=bigfloat.Pow(bigneg2, bigneg2) // PANIC! Pow: negative basefmt.Printf("%f\n", bigquarter)
}
The text was updated successfully, but these errors were encountered:
Hi, Thanks for this great little package!
The
bigfloat.Pow()
function seems a little too restrictive relative to themath.Pow()
standard library equivalent for negative bases with integer exponents (which are well-defined).Thanks!
The text was updated successfully, but these errors were encountered: