# showHex

##### Show numbers in binary and hex and decimal format

Show numbers in binary and hex and decimal format. showHex is a very early version of formatHex, which will eventually be in Rmpfr. Use the HH version of formatHex until the Rmpfr version is released.

##### Usage

```
## not exported
showHex(x, ...)
```## not exported
showBin(x, ..., shift=FALSE, LeftPad="_", RightPad="_")

## not exported
showDec(x, ..., digits, nsmall)

## not exported
showHexInternal(x, precBits=min(Rmpfr::getPrec(x)), ...)

##### Arguments

- x
- Any numeric or mpfr object.
- precBits
- Number of bits of precision.
The default value is the number returned by
`mpfr::.getPrec`

Double precision numbers have 53 bits. For more detail, see`mpfr`

. - shift
- Logical. When
`FALSE`

(the default) the binary representation is displayed in scientific notation (mpfr(3, 5) is displayed as`+0b1.1000p+1`

). When`TRUE`

, the binary representation is in regular format shifted to - ...
- Additional arguments.
`showHexInternal`

,`showHex`

,`showBin`

:`precBits`

is the only`...`

argument acted on. Other`...`

arguments are ignored.`showDec`

:`precBits`

- LeftPad, RightPad
- Characters that will be used for left- and right-padding of the
formatted string when
`shift=TRUE`

. - digits, nsmall
- These arguments are intercepted by
`showDec`

and ignored.`showDec`

generates its own values for these arguments from`precBits`

and forwards those values to`format`

.

```
```

```
```

```
```
##### Details

For the hexadecimal representation, the function
`sprintf`

is used directly. For the binary
representation, the hexadecimal value is calculated and then edited by
substitution of the binary representation of the hex characters coded in
the `HextoBin`

vector. For binary with `shift=TRUE`

, the
result of the `shift=FALSE`

version is edited to align binary
points. For the decimal representation, the hexadecimal value is
calculated with the
specified precision and then sent to the `format`

function.

##### Value

- A character matrix containing the formatted represention of the
argument.
Arithmetic cannot be done on the result.

##### References

R FAQ 7.31: Why doesn't R think these numbers are equal?
`system.file("../../doc/FAQ")`

##### See Also

##### Examples

```
FourBits <- Rmpfr::mpfr(matrix(0:31, 8, 4), precBits=4) ## 4 significant bits
dimnames(FourBits) <- list(0:7, c(0,8,16,24))
FourBits
HH:::showHex(FourBits)
HH:::showBin(FourBits)
HH:::showBin(FourBits, shift=TRUE)
HH:::showDec(FourBits)
TenFrac <- matrix((1:10)/10, dimnames=list(1:10, expression(1/x)))
TenFrac9 <- Rmpfr::mpfr(TenFrac, precBits=9) ## 9 significant bits
TenFrac9
HH:::showHex(TenFrac9)
HH:::showBin(TenFrac9)
HH:::showBin(TenFrac9, shift=TRUE)
HH:::showDec(TenFrac9)
HH:::showDec(TenFrac9, precBits=10)
```

* Documentation reproduced from package HH, version 3.1-23,
License: GPL (>= 2)
*
### Community examples

Looks like there are no examples yet.

```
```

```
```

```
```