Standard library / math
math.Frexp()
Decomposes a finite nonzero value into fraction with magnitude in [0.5,1) and binary exponent. Expected stdout: '0.75 4\n'.
Formal Syntax & Structure
go syntaxgo
func Frexp(f float64) (frac float64, exp int)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| f | float64 | Input floating-point value. |
Return Value
(frac float64, exp int)
Decomposes a finite nonzero value into fraction with magnitude in [0.5,1) and binary exponent.
Working Example
Example Snippetgo
package main
import ( "fmt" "math")
func main() { f, e := math.Frexp(12) fmt.Println(f, e)}