Skip to content

Commit 6a14df3

Browse files
committed
Merge pull request isocpp#89 from egorpugin/master
Domain of sqrt() is nonnegative numbers, not positive.
2 parents 245f82a + 26ad1aa commit 6a14df3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CppCoreGuidelines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,9 +1060,9 @@ Obviously, we cannot catch all errors through the static type system
10601060

10611061
double sqrt(double x);
10621062

1063-
Here `x` must be positive. The type system cannot (easily and naturally) express that, so we must use other means. For example:
1063+
Here `x` must be nonnegative. The type system cannot (easily and naturally) express that, so we must use other means. For example:
10641064

1065-
double sqrt(double x); // x must be positive
1065+
double sqrt(double x); // x must be nonnegative
10661066

10671067
Some preconditions can be expressed as assertions. For example:
10681068

0 commit comments

Comments
 (0)