math.go 254 B

1234567891011121314151617
  1. package fyne
  2. // Min returns the smaller of the passed values.
  3. func Min(x, y float32) float32 {
  4. if x < y {
  5. return x
  6. }
  7. return y
  8. }
  9. // Max returns the larger of the passed values.
  10. func Max(x, y float32) float32 {
  11. if x > y {
  12. return x
  13. }
  14. return y
  15. }