Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/f/fp_precision.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/f/fp_precision.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/f/fp_precision.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/f/fp_precision.html on line 8
Set or get the current precision
#include <fpstatus.h>
int fp_precision( int newprecision );
- newprecision
- The new precision; one of:
- < 0 — return the current setting.
- _FP_PREC_FLOAT
- _FP_PREC_DOUBLE
- _FP_PREC_EXTENDED
- _FP_PREC_DOUBLE_EXTENDED
libm
Use the -l m option to
qcc
to link against this library.
The fp_precision() function sets or gets the current
floating-point precision, depending on the value of
newprecision.
If newprecision is less than 0, the current precision;
otherwise, the previous precision.
|
This function doesn't return a special value to indicate that an error
occurred.
If you want to check for errors, set
errno
to 0, call the function, and then check errno again. |
#include <fpstatus.h>
int main(int argc, char** argv)
{
int ret;
ret = fp_precision(-1);
printf("Precision: ");
if (ret == _FP_PREC_FLOAT)
printf("Float \n");
else if (ret == _FP_PREC_DOUBLE)
printf("Double \n");
else if (ret == _FP_PREC_EXTENDED)
printf("Extended \n");
else if (ret == _FP_PREC_DOUBLE_EXTENDED)
printf("128 Bit \n");
else if (ret == _FP_PREC_EXTENDED)
printf("Extended \n");
else if (ret == _FP_PREC_DOUBLE_EXTENDED)
printf("128 Bit \n");
else
printf("Error \n");
return(0);
}
QNX Neutrino
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
fp_exception_mask(),
fp_exception_value(),
fp_rounding(),
fp_setenv()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/f/fp_precision.html on line 177
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/f/fp_precision.html on line 177