Removed (pretty inconsistently used) tab chars from source code base.
This commit is contained in:
@@ -11,30 +11,30 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
static bool test(int dividend, int divisor) {
|
||||
div_t result;
|
||||
div_t result;
|
||||
|
||||
result = div(dividend, divisor);
|
||||
printf("%+d/%+d= %+d, %+d%%%+d= %+d, div()= %+d, %+d\n",
|
||||
dividend, divisor, dividend / divisor,
|
||||
dividend, divisor, dividend % divisor,
|
||||
result.quot, result.rem);
|
||||
return result.quot * divisor + result.rem != dividend;
|
||||
}
|
||||
result = div(dividend, divisor);
|
||||
printf("%+d/%+d= %+d, %+d%%%+d= %+d, div()= %+d, %+d\n",
|
||||
dividend, divisor, dividend / divisor,
|
||||
dividend, divisor, dividend % divisor,
|
||||
result.quot, result.rem);
|
||||
return result.quot * divisor + result.rem != dividend;
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
bool t;
|
||||
bool t;
|
||||
|
||||
printf("\nTest of division and modulus operations:\n\n");
|
||||
t = test(+40, +3) ||
|
||||
test(+40, -3) ||
|
||||
test(-40, +3) ||
|
||||
test(-40, -3);
|
||||
if (t)
|
||||
printf("\nThe div() function made a wrong result!\n");
|
||||
printf("\nTest of division and modulus operations:\n\n");
|
||||
t = test(+40, +3) ||
|
||||
test(+40, -3) ||
|
||||
test(-40, +3) ||
|
||||
test(-40, -3);
|
||||
if (t)
|
||||
printf("\nThe div() function made a wrong result!\n");
|
||||
#ifdef __ATARI__
|
||||
/* Atari DOS 2 clears the screen after program-termination, so wait. */
|
||||
printf("\nTap a key, to exit. ");
|
||||
getchar();
|
||||
/* Atari DOS 2 clears the screen after program-termination, so wait. */
|
||||
printf("\nTap a key, to exit. ");
|
||||
getchar();
|
||||
#endif
|
||||
return (int)t;
|
||||
}
|
||||
return (int)t;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user