可能重复: C编程部门
可能我的问题非常简单和愚蠢.我想存储的分割的价值,特别是1 / x其中x是一个整数值.
1 / x
x
int x = 17; double result = 1/x;
我尝试这样做,但我总是0.000000 ...试着输入一个固定在x中的值,例如1/17但总是得到相同的值..什么是错的?
0.000000 ...
1/17
c++ math floating-point double visual-studio
c++ ×1
double ×1
floating-point ×1
math ×1
visual-studio ×1