From: "mrkn (Kenta Murata)" <muraken@...>
Date: 2013-08-26T14:08:36+09:00
Subject: [ruby-core:56806] [ruby-trunk - Bug #8818] BigDecimal#power


Issue #8818 has been updated by mrkn (Kenta Murata).

Category changed from core to ext
Assignee set to mrkn (Kenta Murata)
Target version set to current: 2.1.0


----------------------------------------
Bug #8818: BigDecimal#power
https://bugs.ruby-lang.org/issues/8818#change-41346

Author: dunric (David Unric)
Status: Open
Priority: Normal
Assignee: mrkn (Kenta Murata)
Category: ext
Target version: current: 2.1.0
ruby -v: 1.9.3p448, 2.0.0p247
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
Optional argument `prec' to BigDecimal#power does not alter result precision:

 b=BigDecimal.new("1.034482758620689655172413793103448275862068965517241379310344827586206896551724"
 => #<BigDecimal:807a50,'0.1034482758 6206896551 7241379310 3448275862 0689655172 4137931034 4827586206 896551724E1',90(90)>
 b.power(4,5)
 => #<BigDecimal:10bb958,'0.1145230820 5649522608 4116496837 8904565512 1514645522 7837309357 9496692262 3398620909  7657083959 5577995167 4087102580 1626227765 2022322103 9445425509 8044483027 2550796764 5108521224 2376085318 2822668783 6941752994 9199822984 0756361333 0486751376 0443160825 7538375836 4780052058 5170533352 3733848357 3007050945 8051326134 8742578974 976E1',324(513)>

expected result
 => #<BigDecimal:110f508,'0.11453E1',18(27)>
=end



-- 
http://bugs.ruby-lang.org/