Standard library / math

math.Ldexp()

Multiplies frac by 2 raised to exp, inverse of Frexp decomposition. Expected stdout: '12\n'.

Formal Syntax & Structure

go syntaxgo
func Ldexp(frac float64, exp int) float64

Parameters & Attributes

NameTypeDescription
fracfloat64Fractional significand.
expintBinary exponent.

Return Value

float64

Multiplies frac by 2 raised to exp, inverse of Frexp decomposition.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math")
func main() {  fmt.Println(math.Ldexp(0.75, 4))}
Go Reference