buildBinaries {bigBits}R Documentation

Function to convert values to binary form

Description

This function is intended primarily for internal use by the big* Boolean functions. Its job is to take an input in any base, in almost any class (numeric, character, etc) and generate the binary form of the same value.

Usage

buildBinaries(x, y= NULL,inBase, inTwosComp = FALSE, binSize = 32)

Arguments

x, y

The values to be converted. Typically these are the x,y values provided to one of the Boolean functions in this package. If only x is input, y defaults to NULL

inBase

The base (2 thru 36) of the input values.

inTwosComp

When the input inBase is 2, this specifies whether the input is positive unless a negative sign is present, or 2's complement format .

binSize

The minimum number of bits to use for the output binary data. If insufficient for the size of the input(s), this will be increased to the next 4*N size. When there are two inputs, both outputs are set to the same number of bits. ~

Value

xbin

A vector of numeric ones and zeroes representing the binary form of x

ybin

A vector of numeric ones and zeroes representing the binary form of y. If the input is NULL, a single value of 0 is returned.

Author(s)

Author and Maintainer:Carl Witthoft carl@witthoft.com

Examples


buildBinaries(73,-73,inBase=10)


[Package bigBits version 1.3 Index]