(v []float32)
| 537 | } |
| 538 | |
| 539 | func minMax(v []float32) (mn, mx float32) { |
| 540 | if len(v) == 0 { |
| 541 | return 0, 0 |
| 542 | } |
| 543 | mn, mx = v[0], v[0] |
| 544 | for _, x := range v { |
| 545 | if math.IsNaN(float64(x)) || math.IsInf(float64(x), 0) { |
| 546 | continue |
| 547 | } |
| 548 | if x < mn { |
| 549 | mn = x |
| 550 | } |
| 551 | if x > mx { |
| 552 | mx = x |
| 553 | } |
| 554 | } |
| 555 | return mn, mx |
| 556 | } |
no test coverage detected