Operating System - HP-UX
1748140 Members
3753 Online
108758 Solutions
New Discussion юеВ

How do i convert maxdsiz from hex to integer value

 
SOLVED
Go to solution
Matthew_50
Valued Contributor

How do i convert maxdsiz from hex to integer value

Hello experts

From current kernel,
kmtune|grep maxdsiz
maxdsiz 0x90000000 - 0X90000000
maxdsiz_64bit 0x100000000 - 0X100000000

How do I calculate 0x90000000 & 0x100000000 into integer value ?

Thank you.
7 REPLIES 7
Jean-Luc Oudart
Honored Contributor

Re: How do i convert maxdsiz from hex to integer value

Matthew

you can use the calculator scientific mode (on a windows workstation).
select Hex
enter the value
click on Dec

you get the integer value.

Regards
Jean-Luc
fiat lux

Re: How do i convert maxdsiz from hex to integer value

we don't need no stinkin windows ;0)

bc is your friend...

echo "ibase=16;90000000"|bc
echo "ibase=16;100000000"|bc

HTH

Duncan

I am an HPE Employee
Accept or Kudo
James R. Ferguson
Acclaimed Contributor

Re: How do i convert maxdsiz from hex to integer value

Hi Matthew:

There's always Perl, too:

# perl -e 'printf "%d\n",0x100000000'
4294967296

...and Perl has no artificial limits.

Regards!

...JRF...


Matthew_50
Valued Contributor

Re: How do i convert maxdsiz from hex to integer value

so, the value is hex in kernel right ?
as check from hpux 11.0 11.11 have this format. but in hpux 11.23 never see this format.
James R. Ferguson
Acclaimed Contributor
Solution

Re: How do i convert maxdsiz from hex to integer value

Hi (again):

> so, the value is hex in kernel right ?

The notation '0x' means hexadecimal.

By the way, a leading zero (0) in a series of numbers means octal. Hence, 0777 is an octal value whereas 777 would be a decimal number and 0x777 would be a hexadecimal one.

Regards!

...JRF...
Matthew_50
Valued Contributor

Re: How do i convert maxdsiz from hex to integer value

Thank you, you guys have completely answer my questions.
Dennis Handly
Acclaimed Contributor

Re: How do i convert maxdsiz from hex to integer value

>How do I calculate 0x90000000 & 0x100000000 into integer value?

With 11.23 ksh you can do:
$ typeset -i10 x=16#90000000; echo $x
2415919104
(Unfortunately the Posix shell is limited to 32 bits. )-:

You can also use gdb to act as a calculator.
(gdb) p 0x90000000