Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compute ¶
Example ¶
package main
import (
"fmt"
"github.com/CarsonSlovoka/go-pkg/v2/math"
)
func main() {
fmt.Println(math.Compute(3, 2, '+'))
fmt.Println(math.Compute("3.4", 5, '+'))
fmt.Println(math.Compute("3.4", "-5", '-'))
fmt.Println(math.Compute("-10", "5", '-'))
fmt.Println(math.Compute("3.4", "4", '*'))
fmt.Println(math.Compute("3", "1.5", '/'))
}
Output: 5 <nil> 8.4 <nil> 8.4 <nil> -15 <nil> 13.6 <nil> 2 <nil>
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.