View Single Post
  #8 (permalink)  
Old 07-04-2009, 03:18 AM
angryboy's Avatar
angryboy angryboy is offline
Senior Member
 
Join Date: Jan 2009
Location: Javaland
Posts: 742
Rep Power: 2
angryboy is on a distinguished road
Default
Code:
for(int i = 1; i <= vs1; i++) {
  vArray1[vMax-i] = Integer.parseInt(v1.substring(vs1-i,vs1-i+1));
  vArray1[vMax-i] = Integer.parseInt(Character.toString(v1.charAt(vs1-i)));
  vArray1[vMax-i] = Character.digit(v1.charAt(vs1-i),10); //short ;-)
}
I will have to play around w/ this over the weekend before I can comment any further. Right now, I believe this is extremly resource hungry for large numbers because you are creating two arrays with the same size just to align the digits. So if you have a long number, say 64kb long, you will need to create two arrays of 64kb long.
__________________
USE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)
Reply With Quote