MCPcopy
hub / github.com/TheAlgorithms/Go / Int

Function Int

math/max/max.go:6–14  ·  view source on GitHub ↗

Int is a function which returns the maximum of all the integers provided as arguments.

(values ...T)

Source from the content-addressed store, hash-verified

4
5// Int is a function which returns the maximum of all the integers provided as arguments.
6func Int[T constraints.Integer](values ...T) T {
7 max := values[0]
8 for _, value := range values {
9 if value > max {
10 max = value
11 }
12 }
13 return max
14}

Callers 13

PigeonholeFunction · 0.92
unsignedRadixSortFunction · 0.92
QueryMethod · 0.92
UpdateMethod · 0.92
calculateDepthFunction · 0.92
heightMethod · 0.92
MaxSubarraySumFunction · 0.92
MaxCoinsFunction · 0.92
MaxSubArraySumFunction · 0.92
EggDroppingFunction · 0.92
TestMaxFunction · 0.70

Calls

no outgoing calls

Tested by 2

TestMaxFunction · 0.56
TestMaxOfThreeFunction · 0.56