The "math/big" package in Go provides support for arbitrary-precision mathematics with rational numbers, it includes operations like addition, subtraction, multiplication, division, absolute value, power, square root etc. One of the functions available in this package is called "Mul" which performs multiplication on two big floating-point numbers. The function signature is as follows:
func (x *Float) Mul(y *Float) *Float
Here's an example usage of the Mul function:
package main
import ( "fmt" "math/big" )
func main() { x := big.NewFloat(1.23) y := big.NewFloat(4.56) result := new(big.Float).Mul(x, y) fmt.Println(result) }
In this example, we create two new big floating-point numbers x and y, with the values 1.23 and 4.56 respectively. We then call the "Mul" function on these two values using the NewFloat() function. Lastly, we print the result which is the multiplication of x and y.
Overall, the package library in use is "math/big".
Golang Float.Mul - 29 examples found. These are the top rated real world Golang examples of math/big.Float.Mul extracted from open source projects. You can rate examples to help us improve the quality of examples.