I'm trying to understand the argument to BigDecimal#sqrt. I figured it was for precision and it does seem to affect it, but I can't understand the exactly relationship. Can anyone tell me what the argument controls and how?
I'm trying to understand the argument to BigDecimal#sqrt. I figured it was for precision and it does seem to affect it, but I can't understand the exactly relationship. Can anyone tell me what the argument controls and how?
Let me try asking me question a different way... Is this the correct way to get a printable sqrt() with 16 digits precision?
I'm trying to understand the argument to BigDecimal#sqrt. I figured it was for precision and it does seem to affect it, but I can't understand the exactly relationship. Can anyone tell me what the argument controls and how?
Let me try asking my question a different way... Is this the correct way to get a printable square root with N digits precision (N = 16 in this example)?
I don't fully understand what's going on with it, because my C is
pretty weak, but hopefully this will provide some insight from
someone.
···
On 12/22/05, James Edward Gray II <james@grayproductions.net> wrote:
I'm trying to understand the argument to BigDecimal#sqrt. I figured
it was for precision and it does seem to affect it, but I can't
understand the exactly relationship. Can anyone tell me what the
argument controls and how?
On Dec 22, 2005, at 4:04 PM, James Edward Gray II wrote:
I'm trying to understand the argument to BigDecimal#sqrt. I figured it was for precision and it does seem to affect it, but I can't understand the exactly relationship. Can anyone tell me what the argument controls and how?
Let me try asking my question a different way... Is this the correct way to get a printable square root with N digits precision (N = 16 in this example)?
Is it available online anywhere before then or could I trouble you to send it to me privately?
James Edward Gray II
···
On Dec 27, 2005, at 10:27 PM, mathew wrote:
James Edward Gray II wrote:
Let me try asking me question a different way... Is this the correct way to get a printable sqrt() with 16 digits precision?
>> sprintf "%.16f", BigDecimal.new("66543").sqrt(16)
=> "257.9592991151890260"
Yes.
I've written some documentation for BigDecimal which will hopefully be checked in to Ruby some time.