Sqrt returns the square root of its input, or an error for negative inputs.
(input float64)
| 40 | // Sqrt returns the square root of its input, |
| 41 | // or an error for negative inputs. |
| 42 | func Sqrt(input float64) (float64, error) { |
| 43 | if input < 0 { |
| 44 | return 0, fmt.Errorf("square root of negative number not allowed: %f", input) |
| 45 | } |
| 46 | return math.Sqrt(input), nil |
| 47 | } |
nothing calls this directly
no outgoing calls
no test coverage detected