We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From the old trac:
The C functions trunc, round and ceil return 0 if the following conditions are satisfied:
trunc
round
ceil
int8_t
Tested on: Fedora 15 x86 gcc (GCC) 4.6.0 20110530 (Red Hat 4.6.0-9) Command line: gcc -W -Wall test.c -std=c99 -lm
gcc -W -Wall test.c -std=c99 -lm
A small test program:
#include <inttypes.h> #include <stdio.h> #include <math.h> int main() { float f = -33000.5; float origf = f; int8_t n; for (int i=0;i<1000;i++) { n = round(f); if (n==0) printf("%0.2f: %hd --- ", f, n); f += 1.0; } printf("\n"); n = round(origf); printf("round(origf)=%hd, origf=%f\n", n, origf); n = round(-33000.5l); printf("round(-33000.5)=%hd\n", n); return 0; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
From the old trac:
The C functions
trunc
,round
andceil
return 0 if the following conditions are satisfied:int8_t
Tested on: Fedora 15 x86
gcc (GCC) 4.6.0 20110530 (Red Hat 4.6.0-9)
Command line:
gcc -W -Wall test.c -std=c99 -lm
A small test program:
The text was updated successfully, but these errors were encountered: