Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 20 additions & 24 deletions integer/integer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,60 +20,56 @@ import "math"

// IntMax returns the maximum of the params.
// Deprecated: for new code, use the max() builtin instead.
//
//go:fix inline
func IntMax(a, b int) int {
if b > a {
return b
}
return a
return max(a, b)
}

// IntMin returns the minimum of the params.
// Deprecated: for new code, use the min() builtin instead.
//
//go:fix inline
func IntMin(a, b int) int {
if b < a {
return b
}
return a
return min(a, b)
}

// Int32Max returns the maximum of the params.
// Deprecated: for new code, use the max() builtin instead.
//
//go:fix inline
func Int32Max(a, b int32) int32 {
if b > a {
return b
}
return a
return max(a, b)
}

// Int32Min returns the minimum of the params.
// Deprecated: for new code, use the min() builtin instead.
//
//go:fix inline
func Int32Min(a, b int32) int32 {
if b < a {
return b
}
return a
return min(a, b)
}

// Int64Max returns the maximum of the params.
// Deprecated: for new code, use the max() builtin instead.
//
//go:fix inline
func Int64Max(a, b int64) int64 {
if b > a {
return b
}
return a
return max(a, b)
}

// Int64Min returns the minimum of the params.
// Deprecated: for new code, use the min() builtin instead.
//
//go:fix inline
func Int64Min(a, b int64) int64 {
if b < a {
return b
}
return a
return min(a, b)
}

// RoundToInt32 rounds floats into integer numbers.
// Deprecated: use math.Round() and a cast directly.
//
//go:fix inline
func RoundToInt32(a float64) int32 {
return int32(math.Round(a))
}
Loading