Min x

Hello everyone!I need help for something that is more a maths exercise than a programming.So i need to find the min x for this equation x+10^6=x.
what i have done
1
2
3
4
  double e=2;
  while(e+10^6>e){
     e*=e;
  }

but this is not correct.
Mathematically this is not a valid equation:

x + 10^6 = x indeed <=> 10^6 = 0

which is absurd!
#include <stdio.h>
#include <math.h>

int main()
{
double e = 2;
while(e + pow(10,6) > e)
{
e *= e;
}

printf("%lf\n",e);


return 0;
}
rich1 wrote:

1
2
double e = 2;
while(e + pow(10,6) > e)

but this condition is, obviously, always fulfilled and the loop is endless!!!
Condor this not absurd equation.look this x+1=1
in your computer the zero number is not only 0.
Rich1 this what i have done but why this is the min x?
In your original post you wrote this "equation": x + 10^6 = x. Is this equivalent with 10^6 = 0 ? Yes, it is! And it's absurd! This I noticed previously.

Your second post is: x + 1 = 1 which is something else! Equation perfect valid!
Please condor type in google numerical analysis and computer epsilon.for those that know what i am telling
about please help
Topic archived. No new replies allowed.