Commit ab9ffbc4 authored by Andreas Zwinkau's avatar Andreas Zwinkau
Browse files

two more test cases concering Convs and Divs

[r21089]
parent 06e784ee
int x = 42;
int y = 10;
int signed_div(int x, int y) {
printf("%d (should be 4)\n", x / y);
printf("%d (should be 2)\n", x % y);
return (x / y) + (x % y);
}
unsigned int unsigned_div(unsigned int x, unsigned int y) {
printf("%u (should be 4)\n", x / y);
printf("%u (should be 2)\n", x % y);
return (x / y) + (x % y);
}
double f_div(double x, double y) {
printf("%f (should be 4.2)\n", x / y);
return (x / y);
}
int main(void) {
int x = signed_div(42, 10)
+ unsigned_div(42, 10)
+ f_div(42.0, 10.0);
return 16-x;
}
unsigned int MAX_INT = 4294967295;
int main(void) {
double res = MAX_INT;
printf("Res: %f\n", res);
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment