Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

math.go 347B

1234567891011121314151617181920212223
  1. package common
  2. // Abs returns the absolute value of x.
  3. func Abs(x int64) int64 {
  4. y := x >> 63
  5. return (x ^ y) - y
  6. }
  7. // Max returns the highest of the two given ints.
  8. func Max(x, y int) int {
  9. if x >= y {
  10. return x
  11. }
  12. return y
  13. }
  14. // Min returns the lowest of the two given ints.
  15. func Min(x, y int) int {
  16. if x <= y {
  17. return x
  18. }
  19. return y
  20. }