Results 1 to 2 of 2
Thread: possible lose of precision error
- 11-20-2011, 04:31 AM #1
Member
- Join Date
- Nov 2011
- Posts
- 1
- Rep Power
- 0
possible lose of precision error
hi guys
first post on the forum , i hope anyone can help me
i got this error of possible loss of precision whenever i compile this code
public class assignment {
public String encode(String s , int[] a , int []b){
int length=a.length;
QueueObj key1=new QueueObj(length);
StackObj key2= new StackObj(length);
for (int i=0 ; i<length; i++){
key1.enqueue(a[i]);
key2.push(b[length-i]);
}
QueueObj tempkey=new QueueObj(length);
int slength=s.length();
String result;
int offset=0;
int tempkey1=0;
int tempkey2=0;
int askii=0;
for (int i=0; i<slength ; i++){
tempkey1=0;
tempkey2=0;
askii=0;
tempkey1=((Integer)key1.dequeue()).intValue();
key1.enqueue(tempkey1);
if (key2.size()==0){
for (int j=0 ; j<length; j++){
key2.push(tempkey.dequeue());
}
}
tempkey2=((Integer)key2.pop()).intValue();
offset=tempkey1+tempkey2;
askii=s.charAt(i);
askii=askii+offset;
if(askii>122){
int diff=122-askii;
askii=97+diff;
}
char yarabne5las=askii;
result=result+yarabne5las;
}
}
}
the error seems to be in the before last line of coding char yarabne5las=askii;
- 11-21-2011, 01:44 AM #2
Similar Threads
-
ERROR : possible loss of precision
By subith86 in forum New To JavaReplies: 1Last Post: 01-19-2011, 05:17 PM -
Precision
By c_walker in forum New To JavaReplies: 1Last Post: 10-18-2009, 11:36 AM -
how to let the shell window in SWT lose focus
By kents in forum SWT / JFaceReplies: 2Last Post: 06-25-2009, 10:34 AM -
help me- loss of precision error??
By j2vdk in forum New To JavaReplies: 6Last Post: 09-01-2008, 09:23 AM -
Radio button values are not lose
By chockalingam in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 12-03-2007, 08:14 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks