Description Usage Arguments Details Value Author(s) See Also Examples

Allows the access to individual digits in binary (and general g-adic) numbers.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
binary(x,mb=max(maxBit(x,g)),g=2)
unbinary(x,g=2)
bit(x,b,g=2)
## S3 method for class 'numeric'
bit(x,b=0:maxBit(x,g),g=2)
## S3 method for class 'character'
bit(x,b=0:maxBit(x,g),g=2)
bit(x,b,g=2) <- value
## S3 replacement method for class 'numeric'
bit(x,b=0:maxBit(x,g),g=2) <- value
## S3 replacement method for class 'character'
bit(x,b=0:maxBit(x,g),g=2) <- value
maxBit(x,g=2)
## S3 method for class 'numeric'
maxBit(x,g=2)
## S3 method for class 'character'
maxBit(x,g=2)
bitCount(x,mb=max(maxBit(x,g)),g=2)
gsi.orSum(...,g=2)
whichBits(x,mb=max(maxBit(x,g)),g=2,values=c(TRUE))
binary2logical(x,mb=max(maxBit(x,g)),g=2,values=c(TRUE))
``` |

`x` |
a number either represented a g-adic character string or as a integeral numeric value |

`b` |
the indicies of the bits to be processes. The least significant bit has index 0. |

`mb` |
maximal bit. The index of the most significant bit to be treated |

`g` |
the base of the g-adic representation. 2 corresponds to binary numbers, 8 to octal numbers, 16 to hexadecimal numbers. g is limited by 36. |

`value` |
a vector of bit values to be selected or setted. |

`values` |
a vector of bit values that should be considered as TRUE. |

`...` |
some binary numbers |

These routines are primerily intended to manipulate g-adic numbers for user interface purposes and condensed representation of information. They are not intended for a long number arithmetic.

`binary` |
returns a standard binary (or g-adic) character representation of the number |

`unbinary` |
returns a binary (or g-adic) representation of the number |

`bit` |
returns the values of the requested bits. The values are returned as a logical vector for binary numbers an as numeric digit values for other g-adic numbers. |

`maxBit` |
returns the most significant bit represented in the number. This is the highest bit set in numeric numbers and the highest actually given character in a character representation. |

`bitCount` |
returns the g-adic crossfoot of the number. For a binary number this is the number of bits set |

`gsi.orSum` |
Only works for binary numbers and does a parallel or on each of the bits for a list of binary numbers. |

`whichBits` |
returns the indices of the bits acutally set (or more
precisely of the bits with value in |

`binary2logical` |
returns the a true false vector of the bits
acutally set (or more
precisely of the bits with value in |

K.Gerald v.d. Boogaart http://www.stat.boogaart.de

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.