aboutsummaryrefslogtreecommitdiff
path: root/src/math/big/float_test.go
AgeCommit message (Collapse)Author
2015-02-14math/big: use internal validation more consistentlyRobert Griesemer
TBR adonovan Change-Id: If77afa6474af6cad6512f6866725e3ae5acf2e3f Reviewed-on: https://go-review.googlesource.com/4840 Reviewed-by: Robert Griesemer <gri@golang.org>
2015-02-12math/big: implemented Float.Int64, simplified Float.Uint64Robert Griesemer
Change-Id: Ic270ffa7ec6f6dd4b0a951c64ad965447cce1417 Reviewed-on: https://go-review.googlesource.com/4571 Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-11math/big: completed Float.Uint64Robert Griesemer
Change-Id: Ib3738492a2ec8fc99323e687168b17b7239db6ad Reviewed-on: https://go-review.googlesource.com/4511 Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-11math/big: add test cases for Float.Abs and Float.NegRobert Griesemer
Change-Id: Ic5f3864bc6d94d60b754e3ccf72b1d40c5c09117 Reviewed-on: https://go-review.googlesource.com/4510 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-11math/big: implemented Float.Int (truncation of Floats to Ints)Robert Griesemer
Change-Id: Id98f7333fe6ae1b64e0469c6d01f02360c1f8f55 Reviewed-on: https://go-review.googlesource.com/4481 Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-11math/big: When result prec == 0, use at least prec == 64 for SetInt, SetRat.Robert Griesemer
This avoids surprises. Change-Id: Iaae67da2d12e29c4e797ad6313e0895f7ce80cb1 Reviewed-on: https://go-review.googlesource.com/4480 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-10math/big: implemented Frexp, Ldexp, IsInt, Copy, bug fixes, more testsRobert Griesemer
- Frexp, Ldexp are equivalents to the corresponding math functions. - Set now has the same prec behavior as the other functions - Copy is a true assignment (replaces old version of Set) - Cmp now handles infinities - more tests Change-Id: I0d33980c08be3095b25d7b3d16bcad1aa7abbd0f Reviewed-on: https://go-review.googlesource.com/4292 Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-09math/big: API cleanupRobert Griesemer
- better and more consistent documentation - more functions implemented - more tests Change-Id: If4c591e7af4ec5434fbb411a48dd0f8add993720 Reviewed-on: https://go-review.googlesource.com/4140 Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-06math/big: handling of +/-Inf and zero precision, enable zero valuesRobert Griesemer
- clarified representation of +/-Inf - only 0 and Inf values can have 0 precision - a zero precision value used as result value takes the max precision of the arguments (to be fine-tuned for setters) - the zero precision approach makes Float zero values possible (they represent +0) - more tests Missing: Filling in the blanks. More tests. Change-Id: Ibb4f97e12e1f356c3085ce80f3464e97b82ac130 Reviewed-on: https://go-review.googlesource.com/4000 Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-05math/big: add "smoke test" for big.Float divisionRobert Griesemer
Change-Id: Ica419a1215ca33dc1cff1e9e4137f204591e3cee Reviewed-on: https://go-review.googlesource.com/3942 Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-03math/big: build Float.Format on top of Float.AppendRobert Griesemer
Change-Id: I444eec24467f827caa5c88a1c5ae5bce92508b98 Reviewed-on: https://go-review.googlesource.com/3750 Reviewed-by: Alan Donovan <adonovan@google.com>
2015-01-30math/big: split float conversion routines and tests into separate filesRobert Griesemer
No other functional changes. Change-Id: I7e0bb7452c6a265535297ec7ce6a629f1aff695c Reviewed-on: https://go-review.googlesource.com/3674 Reviewed-by: Alan Donovan <adonovan@google.com>
2015-01-30math/big: parsing of fractions and floats in mantissa bases other than 10Robert Griesemer
Change-Id: I1eaebf956a69e0958201cc5e0a9beefa062c71e1 Reviewed-on: https://go-review.googlesource.com/3454 Reviewed-by: Alan Donovan <adonovan@google.com>
2015-01-28math/big: sketched out complete set of Float/string conversion functionsRobert Griesemer
Also: - use io.ByteScanner rather than io.RuneScanner internally - minor simplifications in Float.Add/Sub Change-Id: Iae0e99384128dba9eccf68592c4fd389e2bd3b4f Reviewed-on: https://go-review.googlesource.com/3380 Reviewed-by: Rob Pike <r@golang.org>
2015-01-27math/big: various fixes, enable tests for 32bit platformsRobert Griesemer
- fixed Float.Add, Float.Sub - fixed Float.PString to be platform independent - fixed Float.Uint64 - fixed various test outputs TBR: adonovan Change-Id: I9d273b344d4786f1fed18862198b23285c358a39 Reviewed-on: https://go-review.googlesource.com/3321 Reviewed-by: Robert Griesemer <gri@golang.org>
2015-01-24math/big: disable some tests on 32bit platforms (fix build)Robert Griesemer
TBR: adonovan Change-Id: I59757b5b46a2c533fc5f888423c99d550d3c7648 Reviewed-on: https://go-review.googlesource.com/3264 Reviewed-by: Robert Griesemer <gri@golang.org>
2015-01-24math/big: multi-precision Floats (starting point)Robert Griesemer
Implemented: - +, -, *, /, and some unary ops - all rounding modes - basic conversions - string to float conversion - tests Missing: - float to string conversion, formatting - handling of +/-0 and +/-inf (under- and overflow) - various TODOs and cleanups With precision set to 24 or 53, the results match float32 or float64 operations exactly (excluding NaNs and denormalized numbers which will not be supported). Change-Id: I3121e90fc4b1528e40bb6ff526008da18b3c6520 Reviewed-on: https://go-review.googlesource.com/1218 Reviewed-by: Alan Donovan <adonovan@google.com>