Finding size of Variable

Chris Angelico rosuav at gmail.com
Wed Feb 12 09:06:30 CET 2014


On Wed, Feb 12, 2014 at 6:49 PM,  <wxjmfauth at gmail.com> wrote:
> The day you find an operator working on the set of
> reals (R) and it is somehow "optimized" for N
> (the subset of natural numbers), let me know.

I have yet to find any computer that works with the set of real
numbers in any way. Never mind optimization, they simply cannot work
with real numbers.

As to operations that are optimized for integers (usually not for
naturals - supporting zero and negatives isn't hard), they are legion.
In Python, integers have arbitrary precision, but floats, Fractions,
and Decimals, don't. Nearly any operation on arbitrarily large numbers
will be either more accurate or more efficient (maybe both) with
integers than with any of the other types.

Letting you know, that's all.

ChrisA



More information about the Python-list mailing list