Learn R Programming

binaryLogic (version 0.3.4)

binaryPrefix: Binary prefix (KiB,MiB,..)

Description

Num of byte needed to fit in n * KiB, MiB ..etc.

Usage

binaryPrefix(n, prefix="KiB")

Arguments

n
numeric value
prefix
binary prefix * byte. Expeting a »string«

Value

  • The number of byte fitting in n * binary prefix * byte

Details

KiB <- KibiByte MiB <- MebiByte GiB <- GibiByte TiB <- TebiByte PiB <- PebiByte EiB <- ExiByte ZiB <- ZebiByte YiB <- YobiByte

See Also

bytesNeeded or fillUpToByte or byte

Examples

Run this code
#Get the number of byte needed to hold 0.5 and 1:10 KiB
binaryPrefix(c(0.5,1:10),"KiB")
#Get the number of bit needed to hold 1 KiB
binaryPrefix(1,"KiB")*byte()

Run the code above in your browser using DataLab