Standard library / math
math.Signbit()
Reports sign bit, including negative zero. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func Signbit(x float64) boolParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | float64 | First input operand (or sole input if unary). |
Return Value
bool
Reports sign bit, including negative zero.
Working Example
Example Snippetgo
package main
import ( "fmt" "math")
func main() { fmt.Println(math.Signbit(math.Copysign(0, -1)))}