
On Mon, Feb 7, 2022 at 4:52 PM Christopher Barker <pythonchb@gmail.com> wrote:
From the perspective of some that writes a lot of computational code:
On Mon, Feb 7, 2022 at 10:25 AM Mark Dickinson <dickinsm@gmail.com> wrote:
- Should we require the presence of NaNs in order for CPython to build? - Should we require IEEE 754 floating-point for CPython-the-implementation?
Yes, and yes, together, as Mark suggests
- Should we require IEEE 754 floating-point for Python-the-language?
I would say no, but it should be recommended -- see Victor's example of Micro Python -- though does anyone have an authority over that? IIUC, Micro Python already has a few differences -- but is anyone saying they shouldn't call it Python? Though, with a quick perusal of teh docs, micro Python does seem to support NaN and Inf, at least -- not sure about the rest of 754.
PEP 7 and PEP 11 are only about CPython. Other Python VMs full or partial are free to do what they want with how they implement floats if at all. (they're build time optional in MicroPython as are many Python language syntax features) While we're at it are 64 bit floats required for either cPython or Python
the language?
CPython: yes. we use a double. Python the language: no. (float is single precision on many micropython platforms as it saves precious ram and performance, plus microcontroller fpu hardware like an M4 is usually single precision 32bit)