go/src/math
Robert Griesemer 23fd374bf2 math/big: wrap Float.Cmp result in struct to prevent wrong use
Float.Cmp used to return a value < 0, 0, or > 0 depending on how
arguments x, y compared against each other. With the possibility
of NaNs, the result was changed into an Accuracy (to include Undef).
Consequently, Float.Cmp results could still be compared for (in-)
equality with 0, but comparing if < 0 or > 0 would provide the
wrong answer w/o any obvious notice by the compiler.

This change wraps Float.Cmp results into a struct and accessors
are used to access the desired result. This prevents incorrect
use.

Change-Id: I34e6a6c1859251ec99b5cf953e82542025ace56f
Reviewed-on: https://go-review.googlesource.com/7526
Reviewed-by: Rob Pike <r@golang.org>
2015-03-14 00:48:53 +00:00
..
big math/big: wrap Float.Cmp result in struct to prevent wrong use 2015-03-14 00:48:53 +00:00
cmplx
rand math/rand: fix example_test to show with the correct method 2014-12-23 17:24:24 +00:00
abs.go
abs_386.s
abs_amd64.s
abs_amd64p32.s
abs_arm.s
abs_ppc64x.s all: power64 is now ppc64 2014-12-05 19:13:20 -05:00
acosh.go
all_test.go math: Dim, Max, Min - allow more bit patterns for NaN 2015-02-23 23:07:01 +00:00
asin.go
asin_386.s
asin_amd64.s
asin_amd64p32.s
asin_arm.s
asinh.go
atan.go
atan2.go
atan2_386.s
atan2_amd64.s
atan2_amd64p32.s
atan2_arm.s
atan_386.s
atan_amd64.s
atan_amd64p32.s
atan_arm.s
atanh.go
bits.go
cbrt.go math: faster Cbrt 2015-02-23 21:04:46 +00:00
const.go
copysign.go
dim.go
dim_386.s
dim_amd64.s math: Dim, Max, Min - allow more bit patterns for NaN 2015-02-23 23:07:01 +00:00
dim_amd64p32.s
dim_arm.s
erf.go
exp.go
exp2_386.s
exp2_amd64.s
exp2_amd64p32.s
exp2_arm.s
exp_386.s
exp_amd64.s
exp_amd64p32.s
exp_arm.s
expm1.go
expm1_386.s
expm1_amd64.s
expm1_amd64p32.s
expm1_arm.s
export_test.go
floor.go
floor_386.s
floor_amd64.s
floor_amd64p32.s
floor_arm.s
frexp.go
frexp_386.s
frexp_amd64.s
frexp_amd64p32.s
frexp_arm.s
gamma.go
hypot.go
hypot_386.s
hypot_amd64.s
hypot_amd64p32.s
hypot_arm.s
j0.go
j1.go
jn.go
ldexp.go
ldexp_386.s
ldexp_amd64.s
ldexp_amd64p32.s
ldexp_arm.s
lgamma.go
log.go
log1p.go
log1p_386.s
log1p_amd64.s
log1p_amd64p32.s
log1p_arm.s
log10.go
log10_386.s
log10_amd64.s
log10_amd64p32.s
log10_arm.s
log_386.s
log_amd64.s
log_amd64p32.s
log_arm.s
logb.go
mod.go
mod_386.s
mod_amd64.s
mod_amd64p32.s
mod_arm.s
modf.go
modf_386.s
modf_amd64.s
modf_amd64p32.s
modf_arm.s
nextafter.go math: change Nextafter64 to Nextafter in the description of Nextafter 2015-02-17 14:29:18 +00:00
pow.go
pow10.go
remainder.go
remainder_386.s
remainder_amd64.s
remainder_amd64p32.s
remainder_arm.s
signbit.go
sin.go
sin_386.s
sin_amd64.s
sin_amd64p32.s
sin_arm.s
sincos.go
sincos_386.s
sincos_amd64.s
sincos_amd64p32.s
sincos_arm.s
sinh.go
sqrt.go
sqrt_386.s
sqrt_amd64.s
sqrt_amd64p32.s
sqrt_arm.s
stubs_ppc64x.s all: power64 is now ppc64 2014-12-05 19:13:20 -05:00
tan.go
tan_386.s
tan_amd64.s
tan_amd64p32.s
tan_arm.s
tanh.go
unsafe.go