Standard library / math/big
big.Float.SetMantExp()
Construct mantissa times two to the exponent, adopting mantissa precision and rounding mode. This method writes to the receiver (use a separate destination to preserve inputs when needed). Expected stdout: '12\n'.
Formal Syntax & Structure
go syntaxgo
func (z *Float) SetMantExp(mant *Float, exp int) *FloatParameters & Attributes
| Name | Type | Description |
|---|---|---|
| mant | *Float | Mantissa input or output. |
| exp | int | Binary exponent. |
Return Value
*Float
Returns the result described above; see the example for the observed behavior.
Working Example
Example Snippetgo
package main
import ( "fmt" "math/big")
func main() { fmt.Println(new(big.Float).SetMantExp(big.NewFloat(0.75), 4))}