【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。
2.1.16.5.6 round
Contents
Description
force given value to be nDecimalPlaces
Syntax
double round( double x, UINT nDecimalPlaces )
Parameters
- x
- [input] independent variable
- nDecimalPlaces
- [input] decimal places of x
Return
x with nDecimalPlaces decimal places.
Examples
EX1
void round_ex1() { double x = 34.56789; int nDecimalPlaces = 3; printf("round(%f, %d) = %f", x, nDecimalPlaces, round(x, nDecimalPlaces)); }
Remark
Calculates a double value which is equal to x up to nDecimalPlaces decimal places
See Also
Header to Include
origin.h