Skip to main content
deleted 5 characters in body
Source Link
200_success
  • 144.2k
  • 22
  • 188
  • 473

I would name the error ErrSqrtNegative instead of ErrNegativeSqrt.

math.Sqrt(0) should not be an error.

In case of error, I would use math.NaN(), ErrSqrtNegative(f) as the return values.

I would name the error ErrSqrtNegative instead of ErrNegativeSqrt.

math.Sqrt(0) should not be an error.

In case of error, I would use math.NaN(), ErrSqrtNegative(f) as the return values.

I would name the error ErrSqrtNegative instead of ErrNegativeSqrt.

Sqrt(0) should not be an error.

In case of error, I would use math.NaN(), ErrSqrtNegative(f) as the return values.

NaN is generated by math.NaN()
Source Link
200_success
  • 144.2k
  • 22
  • 188
  • 473

I would name the error ErrSqrtNegative instead of ErrNegativeSqrt.

math.Sqrt(0) should not be an error.

In case of error, I would use math.NaN(), ErrSqrtNegative(f) as the return values.

I would name the error ErrSqrtNegative instead of ErrNegativeSqrt.

math.Sqrt(0) should not be an error.

In case of error, I would use NaN, ErrSqrtNegative(f) as the return values.

I would name the error ErrSqrtNegative instead of ErrNegativeSqrt.

math.Sqrt(0) should not be an error.

In case of error, I would use math.NaN(), ErrSqrtNegative(f) as the return values.

Source Link
200_success
  • 144.2k
  • 22
  • 188
  • 473

I would name the error ErrSqrtNegative instead of ErrNegativeSqrt.

math.Sqrt(0) should not be an error.

In case of error, I would use NaN, ErrSqrtNegative(f) as the return values.