1
0
mirror of https://github.com/golang/go synced 2024-10-03 03:01:21 -06:00
go/src
Mark Pulford a5c44f3e3f math: add RoundToEven function
Rounding ties to even is statistically useful for some applications.
This implementation completes IEEE float64 rounding mode support (in
addition to Round, Ceil, Floor, Trunc).

This function avoids subtle faults found in ad-hoc implementations, and
is simple enough to be inlined by the compiler.

Fixes #21748

Change-Id: I09415df2e42435f9e7dabe3bdc0148e9b9ebd609
Reviewed-on: https://go-review.googlesource.com/61211
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-10-24 22:33:09 +00:00
..
archive archive/tar: ignore ChangeTime and AccessTime unless Format is specified 2017-10-10 20:13:27 +00:00
bufio
builtin
bytes bytes: add examples of Equal and IndexByte 2017-10-16 03:34:28 +00:00
cmd cmd/compile: refactor method expression detection 2017-10-24 22:21:34 +00:00
compress compress/bzip2: fix checksum mismatch on empty reads 2017-09-25 23:05:58 +00:00
container container/heap: call t.Helper() in verify() 2017-09-13 17:22:00 +00:00
context context: fix references to "d" in WithDeadline docs 2017-09-21 03:00:51 +00:00
crypto crypto/elliptic: don't unmarshal invalid encoded points 2017-10-15 02:24:19 +00:00
database/sql database/sql: add driver.ResetSessioner and add pool support 2017-10-24 21:37:46 +00:00
debug debug/dwarf: clarify StructField.ByteSize doc 2017-10-18 21:45:30 +00:00
encoding encoding/csv: update ErrQuote message 2017-10-24 07:10:28 +00:00
errors
expvar expvar: make (*Map).Init clear existing keys 2017-09-11 21:31:51 +00:00
flag flag: simplify switch-case in isZeroValue 2017-10-17 20:23:14 +00:00
fmt fmt: clarify wording of * flag 2017-10-15 06:03:34 +00:00
go go/types: improved documentation for WriteExpr and ExprString 2017-10-23 18:10:06 +00:00
hash
html all: revert "all: prefer strings.IndexByte over strings.Index" 2017-10-05 23:19:10 +00:00
image image/gif: avoid setting defers in the decode loop 2017-10-23 22:59:18 +00:00
index/suffixarray
internal runtime: for kqueue treat EVFILT_READ with EV_EOF as permitting a write 2017-10-20 22:26:30 +00:00
io io: simplify pipe implementation 2017-10-11 20:00:54 +00:00
log log: fix data race on log.Output 2017-09-19 20:35:24 +00:00
math math: add RoundToEven function 2017-10-24 22:33:09 +00:00
mime mime/multipart: permit empty file name 2017-10-24 20:21:03 +00:00
net runtime: for kqueue treat EVFILT_READ with EV_EOF as permitting a write 2017-10-20 22:26:30 +00:00
os os: simplify windows Pipe 2017-10-21 00:22:33 +00:00
path all: revert "all: prefer strings.LastIndexByte over strings.LastIndex" 2017-10-05 23:19:42 +00:00
plugin runtime, plugin: error not throw on duplicate open 2017-09-09 16:26:33 +00:00
reflect reflect: allow Copy to a byte array or byte slice from a string 2017-10-13 02:35:56 +00:00
regexp all: revert "all: prefer strings.IndexByte over strings.Index" 2017-10-05 23:19:10 +00:00
runtime runtime: make errno positive in netpollopen 2017-10-24 03:19:09 +00:00
sort sort: update main example to use Slice along with Sort 2017-09-24 14:40:37 +00:00
strconv unicode: update to Unicode 10.0.0 2017-10-24 12:42:35 +00:00
strings strings: improve readability of IndexAny and LastIndexAny functions. 2017-09-25 18:23:11 +00:00
sync sync/atomic: add memory barriers to Load/StoreInt32 on darwin/arm 2017-10-02 09:57:23 +00:00
syscall syscall: correct type for timeout argument to Select on linux/{arm64,mips64x} 2017-10-13 14:01:17 +00:00
testing testing/iotest: fix NewReadLogger documentation typo 2017-10-19 15:59:21 +00:00
text text/template: add break, continue actions in ranges 2017-10-17 02:06:15 +00:00
time all: revert "all: prefer strings.LastIndexByte over strings.LastIndex" 2017-10-05 23:19:42 +00:00
unicode unicode: update to Unicode 10.0.0 2017-10-24 12:42:35 +00:00
unsafe
vendor/golang_org/x unicode: update to Unicode 10.0.0 2017-10-24 12:42:35 +00:00
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash misc/ios,src/iostest.bash: support GOIOS_DEVICE_ID 2017-08-28 16:37:25 +00:00
make.bash
make.bat
Make.dist
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc