ceiling_n {lazy.tools}R Documentation

Return the Ceiling and Power of the Input using Radix (Base) of n

Description

Return the Ceiling and Power of the Input using Radix (Base) of n

Usage

ceiling_n(x, n = 10)

Arguments

x

input vector, x > 0

n

Radix or Base

Details

When n=10
0 <= x < 10, ceiling_n(x)$val=10, ceiling_n(x)$power=1
10 <= x < 100, ceiling_n(x)$val=100, ceiling_n(x)$power=2
100 <= x < 1000, ceiling_n(x)$val=1000, ceiling_n(x)$power=3
When n=2
0 <= x < 2, ceiling_n(x,2)$val=2, ceiling_n(x,2)$power=1
2 <= x < 4, ceiling_n(x,2)$val=4, ceiling_n(x,2)$power=2
4 <= x < 8, ceiling_n(x,2)$val=8, ceiling_n(x,2)$power=3

Value

A list of:
power The power
val The value of ceiling = n^power

Examples

ceiling_n( c(1,9,10,99,100) )
ceiling_n( c(1,2,3,4,7,8,15,16), n=2 )


[Package lazy.tools version 0.1.4 ]