Project

General

Profile

Actions

Feature #12626

closed

Add ceiling alias for ceil on Numeric objects

Added by jwillems (Jason Willems) almost 8 years ago. Updated over 7 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:76558]

Description

Proposing adding a ceiling alias to the ceil instance method for Numeric, Float, Integer.

Although ceil is familiar as it's an extremely common method name in other languages, ceiling is more readable. Several other methods exist in the standard library with aliased long and short forms. A few examples:

Numeric:
[:imaginary, :imag]
[:rectangular, :rect]
[:to_i, :to_int]
[:conjugate, :conj]

String:
[:to_str, :to_s]

Usage:

> 2.71.ceil
 => 3
> 2.71.ceiling
 => 3
> Fixnum.instance_methods.grep /ceil/
 => [:ceil, :ceiling] 

Files

add_ceiling_alias.patch (4.47 KB) add_ceiling_alias.patch jwillems (Jason Willems), 07/25/2016 08:23 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0