package main
import (
"fmt"
"math"
)
func Construct64bitFloatingPointValue(m float64, e int, s bool) float64 {
sign := 1.0
if s {
sign = -1.0
}
return sign * m * math.Pow(10, float64(e))
}
func main() {
// Mantissa — the core number to be scaled.
m := 5.1 // float64
// exponent
e := 10 // int
// Sign flag: false means positive.
s := false // bool
fmt.Printf("%.0f\n", Construct64bitFloatingPointValue(m, e, s))
}
/*
run:
51000000000
*/