Learn R Programming

numbers (version 0.8-5)

isNatural: Natural Number

Description

Natural number type.

Usage

isNatural(n)

Value

Boolean

Arguments

n

any numeric number.

Details

Returns TRUE for natural (or: whole) numbers between 1 and 2^53-1.

Examples

Run this code
IsNatural <- Vectorize(isNatural)
IsNatural(c(-1, 0, 1, 5.1, 10, 2^53-1, 2^53, Inf))  # isNatural(NA) ?

Run the code above in your browser using DataLab