commit | 363617c7d3afdc9df3caf49a240679d6b6c7cc4b | [log] [tgz] |
---|---|---|
author | Robert Griesemer <gri@golang.org> | Wed Mar 04 17:00:41 2015 -0800 |
committer | Robert Griesemer <gri@golang.org> | Thu Mar 12 18:41:45 2015 +0000 |
tree | 80524a7551907793d0cf27e671a43a021fab2733 | |
parent | 0ff7c3ea458dc9162333efa5ffd1ff9dccfd4fe8 [diff] |
math/big: added (internal) Float.form field for easier case distinctions This is a fairly significant _internal_ representation change. Instead of encoding 0, finite, infinite, and NaN values with special mantissa and exponent values, a new (1 byte) 'form' field is used (without making the Float struct bigger). The form field permits simpler and faster case distinctions. As a side benefit, for zero and non-finite floats, fewer fields need to be set. Also, the exponent range is not the full int32 range (in the old format, infExp and nanExp were used to represent Inf and NaN values and tests for those values sometimes didn't test for the empty mantissa, so the range was reduced by 2 values). The correspondence between the old and new fields is as follows. Old representation: x neg mant exp --------------------------------------------------------------- +/-0 sign empty 0 0 < |x| < +Inf sign mantissa exponent +/-Inf sign empty infExp NaN false empty nanExp New representation (- stands for ignored fields): x neg mant exp form --------------------------------------------------------------- +/-0 sign - - zero 0 < |x| < +Inf sign mantissa exponent finite +/-Inf sign - - inf NaN - - - nan Client should not be affected by this change. Change-Id: I7e355894d602ceb23f9ec01da755fe6e0386b101 Reviewed-on: https://go-review.googlesource.com/6870 Reviewed-by: Alan Donovan <adonovan@google.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
For documentation about how to install and use Go, visit https://golang.org/ or load doc/install-source.html in your web browser.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Please report issues here: https://golang.org/issue/new
Go is the work of hundreds of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
If you have just untarred a binary Go distribution, you need to set the environment variable $GOROOT to the full path of the go directory (the one containing this file). You can omit the variable if you unpack it into /usr/local/go, or if you rebuild from sources by running all.bash (see doc/install-source.html). You should also add the Go binary directory $GOROOT/bin to your shell's path.
For example, if you extracted the tar file into $HOME/go, you might put the following in your .profile:
export GOROOT=$HOME/go export PATH=$PATH:$GOROOT/bin
See https://golang.org/doc/install or doc/install.html for more details.