请考虑以下代码:
0.1 + 0.2 == 0.3 -> false
0.1 + 0.2 -> 0.30000000000000004
为什么会出现这些不准确之处?
language-agnostic math floating-point floating-accuracy
我需要阻止我的双重打印在我的文件中的科学记数法,
当我这样做
outfile << X;
c++ iostream scientific-notation
c++ ×1
floating-accuracy ×1
floating-point ×1
iostream ×1
language-agnostic ×1
math ×1
scientific-notation ×1