How to get the minimum number that can be represented?
invalid at invalid.invalid
Sun Sep 20 16:37:55 CEST 2009
On 2009-09-20, Peng Yu <pengyu.ut at gmail.com> wrote:
> Suppose I want to define a function that return the minimum number
> that can be represented.
> def f(x):
> That it, if I call f(10), f will return the minimum integer that can
> be represented in the machine; if I cal f(10.5), f will return the
> minimum float that can be represented in the machine.
> Could somebody let me know what should be in the function body?
The stuff you wan is in the "sys" module.
max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021,
min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.2204460492503131e-16, radix=2, rounds=1)
You might also want to read up on the type() builtin
More information about the Python-list