Results 1 to 2 of 2
  1. #1
    billymac00 is offline Member
    Join Date
    Apr 2009
    Location
    Northern Calif, USA
    Posts
    1
    Rep Power
    0

    Default 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?

    Thanks
    Attached Files Attached Files
    Last edited by billymac00; 04-07-2009 at 04:40 PM. Reason: missing attachment?

  2. #2
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    7

    Default

    i think it's best that you ask the person who developed this code for you, but yeah, you shouldn't be getting negatives.

Similar Threads

  1. How to find logarithm base 2 value in java
    By RJNARESH in forum Advanced Java
    Replies: 5
    Last Post: 03-19-2009, 10:12 PM
  2. [SOLVED] Base conversions
    By rlzyoner in forum New To Java
    Replies: 3
    Last Post: 12-10-2008, 12:40 PM
  3. [SOLVED] base directory for servlets
    By Nicholas Jordan in forum Java Servlet
    Replies: 11
    Last Post: 07-04-2008, 11:29 PM
  4. Replies: 1
    Last Post: 08-06-2007, 05:38 PM
  5. Connection to data base
    By Daniel in forum JDBC
    Replies: 2
    Last Post: 06-07-2007, 04:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •