Results 1 to 9 of 9
  1. #1
    jon80's Avatar
    jon80 is offline Senior Member
    Join Date
    Feb 2008
    Location
    Malta (EU)
    Posts
    211
    Rep Power
    7

    Talking BigDecimal and BigInteger

    "Immutable, arbitrary-precision signed decimal numbers. A BigDecimal consists of an arbitrary precision integer unscaled value and a 32-bit integer scale. If zero or positive, the scale is the number of digits to the right of the decimal point. If negative, the unscaled value of the number is multiplied by ten to the power of the negation of the scale. The value of the number represented by the BigDecimal is therefore (unscaledValue 10-scale)."

    Source: JAVA API for java.math.BigDecimal
    Java Platform Standard Ed. 6, available at Java Platform SE 6.

    Hence, what is the smallest/largest number that may be represented by BigInteger and BigDecimal, in layman's terms?

    How is it possible to deduce the minimum and maximum values, and, display them programmatically?

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  3. #3
    jon80's Avatar
    jon80 is offline Senior Member
    Join Date
    Feb 2008
    Location
    Malta (EU)
    Posts
    211
    Rep Power
    7

    Default

    Indeed, but it does not seem to answer my questions.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,770
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Eranga View Post
    This may helpful to you. I've just read this few days ago. :)
    That is a crappy page; nothing in it isn't described (in much greater detail) in the API documentation for the BigInteger class. It's a waste of bandwidth and not worthy to be a Wiki page.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    How is it possible to deduce the minimum and maximum values, and, display them programmatically?

    The 32 bit scale of a BigDecimal indicates that it can get big. As Douglas Adams would say: really, really big.

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by jon80 View Post
    Indeed, but it does not seem to answer my questions.
    I agreed. Conceptually for me it is, but not programmatically.

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by JosAH View Post
    It's a waste of bandwidth and not worthy to be a Wiki page.
    Sorry Jos, I cannot agreed with you about this. What I believe is that Wiki is more sophisticated than the Google result.

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,770
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Eranga View Post
    Sorry Jos, I cannot agreed with you about this. What I believe is that Wiki is more sophisticated than the Google result.
    Normally Wiki is fine but the page you linked to was utter crap. Tell me what is good about it that can't be found in the API documentation?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Using BigDecimal
    By doymand in forum New To Java
    Replies: 2
    Last Post: 10-30-2010, 10:25 AM
  2. How do i Multiply a BigDecimal by a Double
    By s0meb0dy in forum New To Java
    Replies: 33
    Last Post: 09-26-2010, 02:05 AM
  3. BigDecimal question
    By orchid in forum New To Java
    Replies: 2
    Last Post: 08-12-2008, 02:44 PM
  4. convert a really big string (len 39) to bigdecimal
    By coolsig in forum Advanced Java
    Replies: 6
    Last Post: 06-14-2008, 03:48 AM
  5. BigDecimal - Help formulating if statments
    By shinjitsunohana in forum New To Java
    Replies: 5
    Last Post: 04-28-2008, 11:12 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
  •