Hi,
Is it possible to compare / output two numbers to a certain precision?
for instance:
#include <stdlib>
#include <math>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
main()
{
double one = 0.987432100
double two = 0.987123456
if ( one == two ) // [[ to a precision of 3 d.p.]]
{
std::cout << "YES! :D ";
} else
{
cout << "No! >:( ";
}
Thanks,
Alex :)
--
Reply to:alex an.ti livingstone sp@am btinternet.com cutting the usual...