w****n 发帖数: 54 | 1 This is the declaration of my function, a constructor actually:
typedef long double number;
Ode::Ode(const number xi, const number xt, const number h, const number y0,
Function& ff) ;
Then I used this function:
Ode tryode(0,10,0.1,0,f);
But when I used gdb to see what happens there, I see h=0.
1000000000000000055511151231257827, not exactly 0.1. Is that due to the
accuracy of the computer?
Thanks | w****n 发帖数: 54 | 2 Please. Even it's a supid question, pleas help me. Many thanks. | t****t 发帖数: 6806 | 3 yes, of course.
y0,
【在 w****n 的大作中提到】 : This is the declaration of my function, a constructor actually: : typedef long double number; : Ode::Ode(const number xi, const number xt, const number h, const number y0, : Function& ff) ; : Then I used this function: : Ode tryode(0,10,0.1,0,f); : But when I used gdb to see what happens there, I see h=0. : 1000000000000000055511151231257827, not exactly 0.1. Is that due to the : accuracy of the computer? : Thanks
| f********r 发帖数: 50 | 4 en, so called round off error in error analysis |
|