Created
June 6, 2012 04:17
-
-
Save dekz/2879895 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~/tmp % ruby -v | |
| jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_31) [darwin-x86_64-java] | |
| ~/tmp % ruby zz.rb | |
| Decimal.new is a Decimal object?: false | |
| Modulo op class is BigDecimal | |
| Times op class is BigDecimal | |
| Div op class is BigDecimal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~/tmp % ruby -v | |
| rubinius 2.0.0dev (1.8.7 4f53f0ce yyyy-mm-dd JI) [x86_64-apple-darwin11.3.0] | |
| ~/tmp % ruby zz.rb | |
| Decimal.new is a Decimal object?: true | |
| Modulo op class is BigDecimal | |
| Times op class is BigDecimal | |
| Div op class is BigDecimal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~/tmp % ruby -v | |
| ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0] | |
| ~/tmp % ruby zz.rb | |
| Decimal.new is a Decimal object?: true | |
| Modulo op class is BigDecimal | |
| Times op class is BigDecimal | |
| Div op class is BigDecimal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "bigdecimal" | |
| class Decimal < BigDecimal | |
| end | |
| puts "Decimal.new is a Decimal object?: #{Decimal.new("9876543210").is_a?(Decimal)}" | |
| dec = Decimal.new("9876543210") | |
| puts "Modulo op class is #{(dec % 2).class}" | |
| puts "Times op class is #{(dec * 2).class}" | |
| puts "Div op class is #{(dec / 2).class}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment