Ask Experts Questions for FREE Help !
Ask
    Blacksage's Avatar
    Blacksage Posts: 2, Reputation: 1
    New Member
     
    #1

    Nov 30, 2007, 12:47 PM
    BigDecimal Sqrt?
    There seems to be know Sqrt method in the BigDecimal Class. They Do have a power method but the power method only takes ints. So I can't try and do something to the .5 or 1/2 power. Dose anyone know of any other way I can find sqrt using Java BigDecimal? Thanks
    jstrike's Avatar
    jstrike Posts: 418, Reputation: 44
    Full Member
     
    #2

    Dec 4, 2007, 08:40 AM
    Try:
    BigDecimal bd = new BigDecimal(343325027336.33);
    Math.sqrt(bd.doubleValue());
    Blacksage's Avatar
    Blacksage Posts: 2, Reputation: 1
    New Member
     
    #3

    Dec 4, 2007, 02:17 PM
    Wouldn't that be the same thing as:
    double x = Math.sqrt(343325027336.33);
    jstrike's Avatar
    jstrike Posts: 418, Reputation: 44
    Full Member
     
    #4

    Dec 14, 2007, 08:12 AM
    Quote Originally Posted by Blacksage
    Wouldnt that be the same thing as:
    double x = Math.sqrt(343325027336.33);
    Yes, but he said he's using the BigDecimal class so you need to go from BigDecimal to double. There may be other BigDecimal methods that he's using prior to needing the square root.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.



View more questions Search