Learn R Programming

adana (version 1.1.0)

encode: Convert from real number to binary number

Description

The function encode converts a real number to a binary number with m digits between the given lower bound and upper bound.

Usage

encode(real, lb, ub, m)

Arguments

real

A real number

lb

Lower bound of real number

ub

Upper bound of real number

m

Number of the digits of output value.

Value

Returns the binary equivalent of the input number.

Details

This function converts a real number to its binary equivalent expressed in m digits in the range [lb, ub].

See Also

decode

Examples

Run this code
# NOT RUN {
x = 102.5
encode(x, lb=50, ub=250, m=8)
# }

Run the code above in your browser using DataLab