From: "naruse (Yui NARUSE)" Date: 2012-08-20T16:54:36+09:00 Subject: [ruby-core:47245] [ruby-trunk - Bug #6862][Assigned] BigMath.exp negative exponent Issue #6862 has been updated by naruse (Yui NARUSE). Status changed from Open to Assigned Assignee set to mrkn (Kenta Murata) ---------------------------------------- Bug #6862: BigMath.exp negative exponent https://bugs.ruby-lang.org/issues/6862#change-28937 Author: karatedog (F��ldes L��szl��) Status: Assigned Priority: Normal Assignee: mrkn (Kenta Murata) Category: Target version: 1.9.3 ruby -v: ruby 1.9.3p260 (2012-08-09 revision 36669) [i686-linux] Ruby 1.9.3 BigMath.exp accepts Fixnum for exponent but silently treats negative exponents as positive: 1.9.3p260 :009 > BigMath.exp(3, 10) => # 1.9.3p260 :010 > BigMath.exp(-3, 10) => # Converting the exponent parameter to BigDecimal solves the problem: 1.9.3p260 :011 > BigMath.exp(BigDecimal(-3), 10) => # -- http://bugs.ruby-lang.org/