diff options
Diffstat (limited to 'src/pkg/math/pow10.go')
| -rw-r--r-- | src/pkg/math/pow10.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pkg/math/pow10.go b/src/pkg/math/pow10.go index bda2e824e..20f91bcb7 100644 --- a/src/pkg/math/pow10.go +++ b/src/pkg/math/pow10.go @@ -10,6 +10,12 @@ var pow10tab [70]float64 // Pow10 returns 10**e, the base-10 exponential of e. func Pow10(e int) float64 { + if e <= -325 { + return 0 + } else if e > 309 { + return Inf(1) + } + if e < 0 { return 1 / Pow10(-e) } |
