source:
CIVL/examples/arithmetic/sqrt.cvl@
dccd621
| Last change on this file since dccd621 was d42b98b, checked in by , 11 years ago | |
|---|---|
|
|
| File size: 214 bytes | |
| Rev | Line | |
|---|---|---|
| [869af89] | 1 | #include <math.h> |
| [d42b98b] | 2 | #include <stdio.h> |
| [869af89] | 3 | |
| 4 | $input double x; | |
| 5 | $assume x >= 0.0; | |
| 6 | ||
| [d42b98b] | 7 | int main(int argc, char * argv[]) { |
| [869af89] | 8 | double y = sqrt(x) + 1; |
| 9 | ||
| [d42b98b] | 10 | if(x == 0.0) |
| 11 | $assert(y == 1); | |
| 12 | else | |
| 13 | $assert(y > 1); | |
| [869af89] | 14 | return 0; |
| 15 | } |
Note:
See TracBrowser
for help on using the repository browser.
