![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archive%g not the same as %e or %f
From: Kent Johnson <kent@kentsjohnson.com>
Date: Fri Apr 14 2006 - 14:02:36 CEST
According to the docs, %g formatting is "Same as "e" if exponent is
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on
In [1]: num = 1234567898.2345678945
In [2]: print "%g\n%e\n%f" % (num,num,num)
In [3]: num = 1234.456789
In [4]: print "%g\n%e\n%f" % (num,num,num)
So I'm wondering if the docs are wrong or the implementation is wrong or
Thanks,
|