powered by
The function encode converts a real number to a binary number with m digits between the given lower bound and upper bound.
encode(real, lb, ub, m)
A real number
Lower bound of real number
Upper bound of real number
Number of the digits of output value.
Returns the binary equivalent of the input number.
This function converts a real number to its binary equivalent expressed in m digits in the range [lb, ub].
decode
# NOT RUN { x = 102.5 encode(x, lb=50, ub=250, m=8) # }
Run the code above in your browser using DataLab