Commit e6f76aac authored by Fazlul Shahriar's avatar Fazlul Shahriar Committed by Ian Lance Taylor

math: be consistent in how we document special cases

Change-Id: Ic6bc4af7bcc89b2881b2b9e7290aeb6fd54804e2
Reviewed-on: https://go-review.googlesource.com/2239Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent e6d35112
...@@ -5,10 +5,11 @@ ...@@ -5,10 +5,11 @@
package math package math
// Nextafter32 returns the next representable float32 value after x towards y. // Nextafter32 returns the next representable float32 value after x towards y.
// Special cases: //
// Special cases are:
// Nextafter32(x, x) = x // Nextafter32(x, x) = x
// Nextafter32(NaN, y) = NaN // Nextafter32(NaN, y) = NaN
// Nextafter32(x, NaN) = NaN // Nextafter32(x, NaN) = NaN
func Nextafter32(x, y float32) (r float32) { func Nextafter32(x, y float32) (r float32) {
switch { switch {
case IsNaN(float64(x)) || IsNaN(float64(y)): // special case case IsNaN(float64(x)) || IsNaN(float64(y)): // special case
...@@ -26,10 +27,11 @@ func Nextafter32(x, y float32) (r float32) { ...@@ -26,10 +27,11 @@ func Nextafter32(x, y float32) (r float32) {
} }
// Nextafter returns the next representable float64 value after x towards y. // Nextafter returns the next representable float64 value after x towards y.
// Special cases: //
// Special cases are:
// Nextafter64(x, x) = x // Nextafter64(x, x) = x
// Nextafter64(NaN, y) = NaN // Nextafter64(NaN, y) = NaN
// Nextafter64(x, NaN) = NaN // Nextafter64(x, NaN) = NaN
func Nextafter(x, y float64) (r float64) { func Nextafter(x, y float64) (r float64) {
switch { switch {
case IsNaN(x) || IsNaN(y): // special case case IsNaN(x) || IsNaN(y): // special case
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment