source: CIVL/examples/library/math/sqrt.c@ f04ee45

1.23 2.0 main test-branch
Last change on this file since f04ee45 was 712457c, checked in by Manchun Zheng <zmanchun@…>, 11 years ago

added tests for the math library.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@2584 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 338 bytes
Line 
1#include<assert.h>
2#include<math.h>
3#include<stdio.h>
4#ifdef _CIVL
5#include<civlc.cvh>
6$assume(sqrt(1)==1);
7#endif
8
9int main(int argc, char** argv) {
10 double a = 1.0/4.0;
11 double b = 1.0/3.0;
12 double c = 1.0;
13 double x = (sqrt(c)*sqrt(c)*b - a)/(sqrt(c)*sqrt(c));
14 printf("FOO: %f\n", x);
15 x = sqrt(x);
16 printf("BAR: %f\n", x);
17}
18
Note: See TracBrowser for help on using the repository browser.