Results 1 to 2 of 2
Thread: base conversion (large)
- 04-07-2009, 04:37 PM #1
Member
- Join Date
- Apr 2009
- Location
- Northern Calif, USA
- Posts
- 1
- Rep Power
- 0
base conversion (large)
I do not use Java but a contact from Germany whipped a small pgm up which seemed to work fine for my needs.
I am merely converting sample text to binary/decimal and finally into a very large number base. The last change he made at my request was to allow base >32-bit.
However, as I slowly increase the base (it's hardcoded), I see negative signs in the final output. Here is the pasted output, I attach the code (as text)
run:
Text: The quick brown fox jumps over the lazy dog
Binary:
1010100 1101000 1100101 100000 1110001 1110101 1101001 1100011 1101011 100000 1100010 1110010 1101111 1110111 1101110 100000 1100110 1101111 1111000 100000 1101010 1110101 1101101 1110000 1110011 100000 1101111 1110110 1100101 1110010 100000 1110100 1101000 1100101 100000 1101100 1100001 1111010 1111001 100000 1100100 1101111 1100111
One big decimal number:
11815744420664747200359014215611078249874077418792 90620375891615821186633473930719017441769795978975 2167
To the base 10000000000000:
[458435666, 1261496934, 37199906, -1076706310, 1826140734, 1244470465, 1757903337]
Remainder 1215352679
BUILD SUCCESSFUL (total time: 0 seconds)
I presume I never should see such minus signs? issue/resolution?
ThanksLast edited by billymac00; 04-07-2009 at 04:40 PM. Reason: missing attachment?
- 04-07-2009, 05:56 PM #2
Senior Member
- Join Date
- Sep 2008
- Posts
- 564
- Rep Power
- 5
Similar Threads
-
How to find logarithm base 2 value in java
By RJNARESH in forum Advanced JavaReplies: 5Last Post: 03-19-2009, 10:12 PM -
[SOLVED] Base conversions
By rlzyoner in forum New To JavaReplies: 3Last Post: 12-10-2008, 12:40 PM -
[SOLVED] base directory for servlets
By Nicholas Jordan in forum Java ServletReplies: 11Last Post: 07-04-2008, 11:29 PM -
Problems when I try to connect to data base
By gabriel in forum JDBCReplies: 1Last Post: 08-06-2007, 05:38 PM -
Connection to data base
By Daniel in forum JDBCReplies: 2Last Post: 06-07-2007, 04:55 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks