[Grml] Calculators (was: [Grml] Is accessing striped "dynamic disks" from GRML possible?)

Michael Prokop mika at grml.org
Thu Nov 2 23:14:50 CET 2006


* Michael Schierl <schierlm-public at gmx.de> [20061102 23:06]:
> Ulrich Dangel schrieb:

> > Try python. Just enter 0xfa or something and you get the corresponding
> > decimal value.

> > If you want the hex value of a decimal number, use hex($numer) and it
> > works.

> and (how) can I reference previous outputs? I can name them beforehand
> but if I do it is lots more to type. Using screen or gdm to copy the
> value is not better either.

> -----
> >>> 0xAFFE
> 45054
> >>> previous * 2
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> NameError: name 'previous' is not defined

> -----

I can strongly recommend using ipython for interactive use of
python (and irb for interactive ruby).

,---- [ demo ]
| % ipython
| Python 2.4.4 (#2, Oct 20 2006, 00:23:25)
| Type "copyright", "credits" or "license" for more information.
|
| IPython 0.7.2 -- An enhanced Interactive Python.
| ?       -> Introduction to IPython's features.
| %magic  -> Information about IPython's 'magic' % functions.
| help    -> Python's own help system.
| object? -> Details about 'object'. ?object also works, ?? prints more.
|
| In [1]: 0xAFFE
| Out[1]: 45054
|
| In [2]: _ * 2
| Out[2]: 90108
`----

> >> There is no orpie (great console RPN calculator) and GNU Calculator
> >> for Emacs is not there either. Okay, dc/bc is there, but I don't know
> >> (and could not figure out by grepping the man page) how they can
> >> handle hex numbers...

> > Hm, i just tried orpie and i think python is much nicer, especially if
> > you use ipython.

> in my experience orpie is nice just because it needs very few key
> strokes (no parentheses, no return, short forms for most extended
> functions) like on a real calculator. GNU Emacs Calculator is similar,
> but a bit larger (and much more powerful). But that does not mean orpie
> is powerless, it has arbitrary-precision integers and matrices as well
> (I am missing fractions in orpie, but can live without, since gcd is
> there; so I can do all fraction calculations "manually").

orpie depends on ocaml-stuff and would require 41.5MB of additional
disk space. So it's not an option for inclusion in grml, sorry.

regards,
-mika-
-- 
You like grml?  Help us!      http://grml.org/donations/
Already on the grml-user-map? http://www.frappr.com/grmlusers
The Grml Planet               http://planet.grml.org/
Grml Solutions                http://solutions.grml.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://ml.grml.org/pipermail/grml/attachments/20061102/c1a8bd9e/attachment-0003.pgp>


More information about the Grml mailing list