hcal and dcal subcommands

The hcal subcommand evaluates hexadecimal expressions and displays the result in both hexadecimal and decimal. The dcal subcommand evaluates decimal expressions and displays the result in both hexadecimal and decimal.

Format

hcal HexadecimalExpression

dcal DecimalExpression

Parameters

Item Description
HexadecimalExpression Specifies the hexadecimal expression to be evaluated.
DecimalExpression Specifies the decimal expression to be evaluated.

Other

hcalcal

dcal has no alias.

Examples

The following is an example of how to use the dcal subcommand and the hcal subcommand:

   KDB(0)> hcal 0x10000  //convert a single value
   Value hexa: 00010000          Value decimal: 65536
   KDB(0)> dcal 1024*1024  //convert an expression
   Value decimal: 1048576          Value hexa: 00100000
   KDB(0)> set 11  //64 bits printing
   64_bit is true
   KDB(0)> hcal 0-1  //convert -1
   Value hexa: FFFFFFFFFFFFFFFF  Value decimal: -1 Unsigned: 18446744073709551615
   KDB(0)> set 11  //32 bits printing
   64_bit is false
   KDB(0)> hcal 0-1  //convert -1
   Value hexa: FFFFFFFF          Value decimal: -1 Unsigned: 4294967295