Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Large String division by integer, without converting that string into BigInteger Format, How can?

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Large String division by integer, without converting that string into BigInteger Format, How can?

    big String like "1234569512354789523641257896321456321457895214453 1214553362511455224555", without converting this string into BIGINTEGER format, divide this string with a integer value......

    input String like this

    String longString="12345695123547895236412578963214563214 578952144531214553362511455224555";
    int divisor=5;


  2. #2
    Member angstrem's Avatar
    Join Date
    Mar 2013
    Location
    Ukraine
    Posts
    200
    My Mood
    Happy
    Thanks
    9
    Thanked 31 Times in 29 Posts

    Default Re: Large String division by integer, without converting that string into BigInteger Format, How can?

    What have you tried?

  3. #3
    Junior Member
    Join Date
    May 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Large String division by integer, without converting that string into BigInteger Format, How can?

    i dont have any idea to solving this,

    How do i go for next, i mean
    we divide integers,float,long,double,biginteger values by these......

    but how i divide a string( Large String contains numeric digits) by integer, without converting it into biginteger

  4. #4
    Member angstrem's Avatar
    Join Date
    Mar 2013
    Location
    Ukraine
    Posts
    200
    My Mood
    Happy
    Thanks
    9
    Thanked 31 Times in 29 Posts

    Default Re: Large String division by integer, without converting that string into BigInteger Format, How can?

    I can give 2 hints:
    1) Consider Integer.parseInt(). You can't use it for a whole string, but you can use it for a tiny part of string
    2) Try a simple division by yourself on a sheet of paper. Say, 3354/43. Try identifying recursive patterns in the process. Recursion is a key to this problem.

  5. #5
    Junior Member
    Join Date
    May 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Large String division by integer, without converting that string into BigInteger Format, How can?

    Quote Originally Posted by angstrem View Post
    I can give 2 hints:
    1) Consider Integer.parseInt(). You can't use it for a whole string, but you can use it for a tiny part of string
    2) Try a simple division by yourself on a sheet of paper. Say, 3354/43. Try identifying recursive patterns in the process. Recursion is a key to this problem.
    ok but he mentioned without converting it into integer datatypes

    --- Update ---

    thank you angstrem for replying my post

  6. #6
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Large String division by integer, without converting that string into BigInteger Format, How can?

    Quote Originally Posted by shiva17 View Post
    without converting this string into BIGINTEGER format, divide this string with a integer value
    Quote Originally Posted by shiva17 View Post
    ok but he mentioned without converting it into integer datatypes
    BigInteger Integer and int are three different things.
    Not much can be said without a clear description of the rules
    If all else fails paste the instructions to your assignment with your question

  7. #7
    Junior Member
    Join Date
    May 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Re: Large String division by integer, without converting that string into BigInteger Format, How can?

    Quote Originally Posted by shiva17 View Post
    ok but he mentioned without converting it into integer datatypes

    --- Update ---

    thank you angstrem for replying my post
    hi, angstrem

    Thanks for ur sujjestion, finally iam getting that one with the help of ur Idea, once again thanks angstrem....

Similar Threads

  1. Fastest way to read and search a string in a large file using core java
    By patilsn_jay in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: November 26th, 2012, 04:35 AM
  2. Fastest way to read and search a string in a large file using java
    By patilsn_jay in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 24th, 2012, 09:29 AM
  3. Converting a String to an Int? Is it possible?
    By Gravity Games in forum Java Theory & Questions
    Replies: 2
    Last Post: July 14th, 2012, 11:21 PM
  4. Help with code for converting 4 digit string to integer
    By danielp1213 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: October 24th, 2011, 09:38 PM
  5. Converting to String
    By darek9576 in forum Object Oriented Programming
    Replies: 1
    Last Post: March 13th, 2010, 06:09 PM

Tags for this Thread