math_test.go 432 B

123456789101112131415161718192021222324
  1. package math
  2. import (
  3. "fmt"
  4. "testing"
  5. )
  6. func TestRand(t *testing.T) {
  7. fmt.Println("Abs: ", Abs(-45.6))
  8. fmt.Println("Round: ", Round(3.1), " ", Round(3.6))
  9. fmt.Println("Floor: ", Floor(3.1), " ", Floor(3.6))
  10. fmt.Println("Ceil: ", Ceil(3.1), " ", Ceil(3.6))
  11. fmt.Println("Max: ", Max(1, 2, 3.5, 4))
  12. fmt.Println("Min: ", Min(1, 2, 3.5, 4))
  13. fmt.Println("DecBin: ", DecBin(10))
  14. fmt.Println("DecHex: ", DecHex(10))
  15. }