Project

General

Profile

Feature #6973

Add an #integral? method to Numeric to test for whole-number values

Added by regularfry (Alex Young) about 8 years ago. Updated almost 3 years ago.

Status:
Assigned
Priority:
Normal
Target version:
-
[ruby-core:47409]

Description

Numeric#integer? checks whether an instance is an Integer. It is often useful to check whether the value of a non-Integer variable is actually a whole number, and the #integer? method doesn't help here.

This patch adds Numeric#integral?, which performs this check.


Files

integral.patch (2.43 KB) integral.patch regularfry (Alex Young), 09/04/2012 06:03 AM

Related issues

Related to Ruby master - Feature #5310: Integral objectsAssignedmrkn (Kenta Murata)Actions

Also available in: Atom PDF