1
0
mirror of https://github.com/golang/go synced 2024-11-26 18:16:48 -07:00

math: be consistent in how we document special cases

Change-Id: Ic6bc4af7bcc89b2881b2b9e7290aeb6fd54804e2
Reviewed-on: https://go-review.googlesource.com/2239
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Fazlul Shahriar 2015-01-01 22:16:38 -05:00 committed by Ian Lance Taylor
parent e6d3511264
commit e6f76aac32

View File

@ -5,10 +5,11 @@
package math
// Nextafter32 returns the next representable float32 value after x towards y.
// Special cases:
//
// Special cases are:
// Nextafter32(x, x) = x
// Nextafter32(NaN, y) = NaN
// Nextafter32(x, NaN) = NaN
// Nextafter32(NaN, y) = NaN
// Nextafter32(x, NaN) = NaN
func Nextafter32(x, y float32) (r float32) {
switch {
case IsNaN(float64(x)) || IsNaN(float64(y)): // special case
@ -26,10 +27,11 @@ func Nextafter32(x, y float32) (r float32) {
}
// Nextafter returns the next representable float64 value after x towards y.
// Special cases:
//
// Special cases are:
// Nextafter64(x, x) = x
// Nextafter64(NaN, y) = NaN
// Nextafter64(x, NaN) = NaN
// Nextafter64(NaN, y) = NaN
// Nextafter64(x, NaN) = NaN
func Nextafter(x, y float64) (r float64) {
switch {
case IsNaN(x) || IsNaN(y): // special case