How to use pow with integers in Go

1 Answer

0 votes
package main

import (
  "fmt"
  "math"
)

func powInt(x, y int) int {
    return int(math.Pow(float64(x), float64(y)))
}

func main() {

	fmt.Println(powInt(3, 4))
}




/*
run:
  
81
  
*/

 



answered Oct 19, 2021 by avibootz
...