Project

General

Profile

Actions

Feature #18179

open

Add Math methods to Numeric

Added by ankane (Andrew Kane) over 2 years ago. Updated about 2 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:105349]

Description

Hi, I wanted to get thoughts on adding class methods from Math as instance methods on Numeric.

x.sqrt # vs Math.sqrt(x)
x.log  # vs Math.log(x)

Rust takes this approach and it (subjectively) feels more intuitive/object-oriented. It also seems more consistent with methods like x.abs.


Related issues 1 (1 open0 closed)

Has duplicate Ruby master - Feature #18477: Float#sqrt and Integer#sqrtOpenActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0