Results 1 to 7 of 7
Thread: numerical problem
 12222013, 11:55 PM #1Member
 Join Date
 Jun 2013
 Posts
 10
 Rep Power
 0
 12232013, 12:10 AM #2Senior Member
 Join Date
 Jan 2013
 Location
 Northern Virginia, United States
 Posts
 5,024
 Rep Power
 9
Re: numerical problem
First, what does this have to do with Java? Second, x does not exist. Subtract x from both sides and you get 10^5 = 0 which is false.
Regards,
JimThe Java^{TM} Tutorials  SSCCE  Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
 12232013, 12:23 AM #3Member
 Join Date
 Jun 2013
 Posts
 10
 Rep Power
 0
Re: numerical problem
Ok i have to explain more.This is an equation with the numerical analysis rules(computer epsilon)
I type here my question because i want to make a programm in java that compute the min x
thanks for anwser me.
 12232013, 01:02 AM #4Senior Member
 Join Date
 Jan 2013
 Location
 Northern Virginia, United States
 Posts
 5,024
 Rep Power
 9
Re: numerical problem
Well, unfortunately I am unable to help. I have had numerical analysis a long time ago but I am still not certain what you are asking. But there are lots of bright people on this forum so one of them should be able to help. However, no one here will write the code for you. They will only give you hints and point you in the right direction.
Regards,
JimThe Java^{TM} Tutorials  SSCCE  Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
 12232013, 01:27 AM #5Member
 Join Date
 Jun 2013
 Posts
 10
 Rep Power
 0
Re: numerical problem
Thanks jim.Of course i dont want the code from anyone.i have make something
but i m not sure that this is correct:
double e=2;
while(e+10^6>e){
e*=e;
}
So with the first look this is an infinity loop but for a big e its equals.so when we exit the loop the
e is the min x?
 12232013, 02:14 AM #6
Re: numerical problem
Strange that ( x + N > x ) can be false with N > 0. Is this some test of the limits of computers to hold a numeric value? For example large positive int values roll over to negative values when they reach their bit size limit. For example:
Java Code:int x = 0x7FFFFFFF; System.out.println(x > (x + 1)); // true
If you don't understand my response, don't ignore it, ask a question.
 12232013, 02:59 AM #7Senior Member
 Join Date
 Jan 2013
 Location
 Northern Virginia, United States
 Posts
 5,024
 Rep Power
 9
Re: numerical problem
Well, looking at your loop I still say that e + 10^6 > e will always be true since e will never be negative from a pure mathematical sense. Now e *= e can approach infinity in Java. But your loop would stop earlier due to limitations of decimal computations. Perhaps that is what you are seeking.
And it should be
Java Code:while(e + 1_000_0000 > e) //or double error = Math.pow(10,6); while (e + error > e)
JimThe Java^{TM} Tutorials  SSCCE  Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
Similar Threads

Validate user input (positive and numerical)
By neveser in forum New To JavaReplies: 1Last Post: 11282012, 11:00 AM 
to print a letter grade for a numerical GPA
By 4uAngelique in forum New To JavaReplies: 16Last Post: 04142012, 08:01 AM 
Allow only numerical input on JTextField
By patriotsfan in forum AWT / SwingReplies: 3Last Post: 05312011, 12:39 PM 
Defining numerical set in java
By veronique in forum New To JavaReplies: 8Last Post: 05042011, 08:08 AM 
Reading Numerical Data
By tyang in forum New To JavaReplies: 1Last Post: 02052010, 04:19 AM
Bookmarks