18 Nov
2002
18 Nov
'02
11:38
Hi! Am Mon, 2002-11-18 um 02.50 schrieb Ralf Corsepius:
Am Son, 2002-11-17 um 10.50 schrieb Sebastian Huber:
also mir ist das immer noch nicht klar, wie numerische Ungenauigkeiten und Optimierung zusammenhaengen.
Garnicht.
Na ja. http://gcc.gnu.org/fom_serv/cache/49.html #include <iostream> int main() { double min = 0.0; double max = 0.5; double width = 0.01; std::cout << static_cast<int>(((max - min) / width) - 1) << std::endl; return 0; } ~> g++ -o testprog test.cc ~> ./testprog 48 ~> g++ -O -o testprog test.cc ~> ./testprog 49 ~> g++ -ffloat-store -O -o testprog test.cc ~> ./testprog 48 Strange... CU, Martin