[Python-Dev] Progress report on PEP 242

Paul F. Dubois paul@pfdubois.com
Sat, 7 Apr 2001 10:33:57 -0700


If I understand correctly I need to supply a reference implementation for
PEP 242.

I have made considerable progress on this:

C:\Paul\Numerical\Packages\kinds>python
Python 2.1b2 (#12, Mar 23 2001, 14:01:30) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> import kinds
>>> f=kinds.float_kind(5,100)
>>> f.max
1.7976931348623157e+308
>>> f.min
2.2250738585072014e-308
>>> f.epsilon
2.2204460492503131e-016
>>> f.radix
0.3010299956639812
>>> f.epsilonbyradix
1.1102230246251565e-016
>>> 10.0**f.radix
2.0    # in case you were wondering...
>>> f(7)
7.0
>>>

These five attributes are the standard ones computed by routines such as
d1mach.
(See netlib.org, search for d1mach).

These attributes I made up:

f.name ('Float' in this case)
f.typecode ('d' in this case, a typecode suitable for modules array or
Numeric

I haven't updated the PEP itself with the comments I got, but it essentially
amounts to fixing the section on coercion, which I mainly realized I don't
really have to deal with.