[#47409] [ruby-trunk - Feature #6973][Open] Add an #integral? method to Numeric to test for whole-number values — "regularfry (Alex Young)" <alex@...>

12 messages 2012/09/03

[#47481] [ruby-trunk - Bug #7008][Open] rake is crashing when trying to compile ffi gem — "drookie (Eugene M. Zheganin Eugene M. Zheganin)" <eugene@...>

10 messages 2012/09/12

[#47505] [ruby-trunk - Feature #7019][Open] allow `private` and `protected` keywords to take blocks — "alexeymuranov (Alexey Muranov)" <redmine@...>

15 messages 2012/09/13

[#47582] [ruby-trunk - Bug #7037][Open] float formatting inconsistently rounds half to even — "headius (Charles Nutter)" <headius@...>

14 messages 2012/09/19

[#47638] [ruby-trunk - Bug #7046][Open] ERB#run and ERB#result are not safe for concurrent use — "headius (Charles Nutter)" <headius@...>

11 messages 2012/09/21

[#47655] [ruby-trunk - Feature #7051][Open] Extend caller_locations API to include klass and bindings. Allow caller_locations as a method hanging off Thread. — "sam.saffron (Sam Saffron)" <sam.saffron@...>

13 messages 2012/09/23

[#47657] [ruby-trunk - Feature #7055][Open] Allow `.foo=` as a synonym of `self.foo=` — "alexeymuranov (Alexey Muranov)" <redmine@...>

11 messages 2012/09/23

[#47730] [ruby-trunk - Bug #7085][Open] Subversion → GitHub gateway stops. — "shyouhei (Shyouhei Urabe)" <shyouhei@...>

27 messages 2012/09/29

[#47735] [ruby-trunk - Bug #7087][Open] ::ConditionVariable#wait does not work with Monitor because Monitor#sleep does not exist — "rklemme (Robert Klemme)" <shortcutter@...>

10 messages 2012/09/29

[#47759] [ruby-trunk - Bug #7092][Open] StringScanner start-of-line matches false positives, while lookbehind for a newline gives false negatives — "jayferd (Jay Adkisson)" <jjmadkisson@...>

8 messages 2012/09/30

[ruby-core:47632] [ruby-trunk - Bug #7044][Open] BigDecimal#power randomly raises coercion errors

From: "twooster (Tony Wooster)" <twooster@...>
Date: 2012-09-21 15:26:09 UTC
List: ruby-core #47632
Issue #7044 has been reported by twooster (Tony Wooster).

----------------------------------------
Bug #7044: BigDecimal#power randomly raises coercion errors
https://bugs.ruby-lang.org/issues/7044

Author: twooster (Tony Wooster)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]


When running the following code:

    require 'bigdecimal'

    10000.times { BigDecimal.new('1001.10')**0.75; putc '.' }

The call to ** will sometimes (not always) raise the following trace:

    ..............................................TypeError: #<Class:0x0000001cd78f40> can't be coerced into BigDecimal
    	from (irb):4:in `**'
    	from (irb):4:in `block in irb_binding'
    	from (irb):3:in `times'
    	from (irb):3
    	from /home/tony/.rbenv/versions/1.9.3-p194/bin/irb:12:in `<main>'

(The '.'s being the debug print of the putc.) I understand the documentation says only integer powers are supported for BigDecimal, however there is code support for floats and rationals, and it should fail or work reliably either way.



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

In This Thread

Prev Next