由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - Why the number is not exact in C++
相关主题
C++ STL map find does not work ???有段c++代码看不懂
请教一个C++ typedef的问题一个C语言的面试题,有点乱,麻烦看一下
为啥允许这样的const设计question about const reference
如何使用这个template?difference between FILE and struct FILE
请问const myClass &src 和myClass const &src有什么区别?C++中size_type怎么处理?
问个小问题typedef
急问:VS2008里如何调用DLL请教一个2维动态矩阵的问题
typedef const char *month Table[3]C++ array new一问
相关话题的讨论汇总
话题: number话题: ode话题: const话题: c++话题: why
进入Programming版参与讨论
1 (共1页)
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
1 (共1页)
进入Programming版参与讨论
相关主题
C++ array new一问请问const myClass &src 和myClass const &src有什么区别?
typedef basic_string string;问个小问题
请教一道C语言的题目急问:VS2008里如何调用DLL
C++ Template Questiontypedef const char *month Table[3]
C++ STL map find does not work ???有段c++代码看不懂
请教一个C++ typedef的问题一个C语言的面试题,有点乱,麻烦看一下
为啥允许这样的const设计question about const reference
如何使用这个template?difference between FILE and struct FILE
相关话题的讨论汇总
话题: number话题: ode话题: const话题: c++话题: why