Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Nov 2003 12:18:08 +0100
From:      Francesco Casadei <fcasadei@inwind.it>
To:        Zhang Weiwu <weiwuzhang@hotmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: simpliest way to calculate octal?
Message-ID:  <20031110111808.GA1604@goku.kasby>
In-Reply-To: <Law11-F29PdUmUrrjZs0004f0ed@hotmail.com>
References:  <Law11-F29PdUmUrrjZs0004f0ed@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--AhhlLboLdkugWU4S
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Nov 10, 2003 at 02:35:35PM +0800, Zhang Weiwu wrote:
> Hello. Pretty newbie question again:)
>=20
> Today I found I cannot calculate what is the octal form of 0xa04e.
>=20
> First I thought xcalc should do the work, but it seems only deal with=20
> decimal.
>=20
> I have perl, tcsh, python interprater. It is likely that they are all=20
> capable of this kind, but what are the commands for them? What's the most=
=20
> convenient way?
>=20
> _________________________________________________________________
> ???????? MSN Explorer:   http://explorer.msn.com/lccn =20
>=20
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o=
rg"
> end of the original message

You can use 'bc' for this and other conversions:

$ echo 'ibase =3D 16; obase =3D 8; A04E' | bc
120116

ibase and obase are the input and output base respectively. Note that you
must use capital letters for exadecimal numbers, lower case letters are
variable names.
See bc(1) manual page for more information.

    Francesco Casadei
--=20
You can download my public key from http://digilander.libero.it/fcasadei/
or retrieve it from a keyserver (pgpkeys.mit.edu, wwwkeys.pgp.net, ...)

Key fingerprint is: 1671 9A23 ACB4 520A E7EE  00B0 7EC3 375F 164E B17B


--AhhlLboLdkugWU4S
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/r3PvfsM3XxZOsXsRAjShAJ9gWTJroWOZUhehGpK2H/2XKyVhfACaApOL
Iw2BTGAj9BwVNjEGpmqFDOc=
=b8g+
-----END PGP SIGNATURE-----

--AhhlLboLdkugWU4S--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031110111808.GA1604>