Standard library / math
math.Floor()
Largest integer-valued float not above x. Expected stdout: '-2\n'.
Formal Syntax & Structure
go syntaxgo
func Floor(x float64) float64Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | float64 | First input operand (or sole input if unary). |
Return Value
float64
Largest integer-valued float not above x.
Working Example
Example Snippetgo
package main
import ( "fmt" "math")
func main() { fmt.Println(math.Floor(-1.2))}