Standard library / math
math.Nextafter()
Adjacent float64 representable value in direction y; if equal returns y. Expected stdout: '1.0000000000000002\n'.
Formal Syntax & Structure
go syntaxgo
func Nextafter(x, y float64) (r float64)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | float64 | First input operand (or sole input if unary). |
| y | float64 | Second input operand. |
Return Value
(r float64)
Adjacent float64 representable value in direction y; if equal returns y.
Working Example
Example Snippetgo
package main
import ( "fmt" "math")
func main() { fmt.Println(math.Nextafter(1, 2))}