Results 1 to 1 of 1
Thread: Wrong precision
- 09-28-2009, 09:55 AM #1
Member
- Join Date
- Aug 2009
- Posts
- 22
- Rep Power
- 0
Wrong precision
It stated that the precision is wrong.Java Code:public class CalInfiniteSeries implements ActionListener { public void actionPerformed(ActionEvent event) { int inputNum; double calSeries; String text = firstField.getText(); inputNum = Integer.parseInt(text); for(int n=0;n<=1000;n++) {calSeries = (Math.pow(-1,n))/(n+1.0);} thirdField.setText(Double.toString(calSeries)); } }
How should I corrected it?
Similar Threads
-
What am I doing wrong??
By NoNickName in forum New To JavaReplies: 3Last Post: 04-23-2009, 11:04 PM -
what's wrong in here!!!
By Annatar in forum New To JavaReplies: 8Last Post: 11-14-2008, 02:55 AM -
help me- loss of precision error??
By j2vdk in forum New To JavaReplies: 6Last Post: 09-01-2008, 09:23 AM -
How do I convert a decimal value to hexadecimal with double precision (64 bit)
By SKaur in forum New To JavaReplies: 7Last Post: 01-12-2008, 09:02 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks