Advertisement
Guest User

Untitled

a guest
Sep 21st, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.29 KB | None | 0 0
  1. # ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
  2. require 'bigdecimal'
  3.  
  4. 10000.times do
  5.   b = BigDecimal.new(1000+Random.rand(5000)) / 100
  6.   # b.class => BigDecimal
  7.   (b**0.75).floor # _sometimes_ raises TypeError: #<Class:0x000000277a3a38> can't be coerced into BigDecimal
  8. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement