Kbase P43164: How to know about bits or bytes takes a positive integer num
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  12/03/2003 |
|
Status: Unverified
GOAL:
How to know about bits or bytes takes a positive integer number?
FIX:
A good 4GL way to know how many bits requires a number is to round down the value of LOG(number,2)
<code>i.e: INT(LOG(PositiveIntergerNumber,2) - 0.5)</code>
For the number of byte, you shall use:
<code>i.e: INT(LOG(PositiveIntergerNumber,256) - 0.5)</code>