D
Daniel Harple
$ruby-yarv -v
ruby 2.0.0 (Base: Ruby 1.9.0 2006-02-14) [powerpc-darwin8.5.0]
YARVCore 0.4.0 Rev: 466 (2006-02-22) [opts: ]
$ruby -v
ruby 1.8.4 (2005-12-24) [powerpc-darwin8.3.0]
# Correct behavior
num = "+3"
Float(num) # -> 3.0
Integer(num) # -> 3
# Strange behavior
num = "3e2"
Float(num) # -> 300.0
Integer(num) # -> ArgumentError
Why is an ArgumentError raised in the second example?
OT: ruby-talk seems to be rejecting my email. I sent this twice, and
both times it did not make it to the list.
-- Daniel
ruby 2.0.0 (Base: Ruby 1.9.0 2006-02-14) [powerpc-darwin8.5.0]
YARVCore 0.4.0 Rev: 466 (2006-02-22) [opts: ]
$ruby -v
ruby 1.8.4 (2005-12-24) [powerpc-darwin8.3.0]
# Correct behavior
num = "+3"
Float(num) # -> 3.0
Integer(num) # -> 3
# Strange behavior
num = "3e2"
Float(num) # -> 300.0
Integer(num) # -> ArgumentError
Why is an ArgumentError raised in the second example?
OT: ruby-talk seems to be rejecting my email. I sent this twice, and
both times it did not make it to the list.
-- Daniel