Project

General

Profile

Actions

Bug #6477

closed

BigDecimal to_i and to_int methods

Added by andhapp (Anuj Dutta) over 12 years ago. Updated over 12 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
1.9.3-p194
Backport:
[ruby-core:45177]

Description

Hello,

Why are there two methods, to_i and to_int, in BigDecimal when they are exactly same in terms of functionality. Here's the link to the docs:

http://www.ruby-doc.org/stdlib-1.9.3/libdoc/bigdecimal/rdoc/BigDecimal.html#method-i-to_i

Am I missing something? Please enlighten.

Thanks.

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

  • Status changed from Open to Rejected

=begin
They are not specific to (({BigDecimal})).

(({to_i})) is for explicit conversion, called by users.
(({to_int})) is for implicit conversion, called by core/libraries.
=end

Actions

Also available in: Atom PDF

Like0
Like0