From b28802d2f1ba9ef49fc3608d7026a524a98bdddb Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 8 Apr 2015 12:28:44 -0700 Subject: math/big: make ErrNaN actually implement the error interface (oversight) There was no way to get to the error message before. Change-Id: I4aa9d3d9f468c33f9996295bafcbed097de0389f Reviewed-on: https://go-review.googlesource.com/8660 Reviewed-by: Alan Donovan --- src/math/big/float.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/math/big/float.go') diff --git a/src/math/big/float.go b/src/math/big/float.go index ed55e8e513..35ad2567e7 100644 --- a/src/math/big/float.go +++ b/src/math/big/float.go @@ -71,6 +71,11 @@ type ErrNaN struct { msg string } +// ErrNan implements the error interface. +func (err ErrNaN) Error() string { + return err.msg +} + // NewFloat allocates and returns a new Float set to x, // with precision 53 and rounding mode ToNearestEven. // NewFloat panics with ErrNaN if x is a NaN. -- cgit v1.3-5-g9baa