<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/tests/float/float_parse_doubleprec.py, branch 6.0.0-alpha.2</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.0.0-alpha.2</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.0.0-alpha.2'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2018-02-26T04:54:03+00:00</updated>
<entry>
<title>tests/float: Adjust float-parsing tests to pass with only a small error.</title>
<updated>2018-02-26T04:54:03+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-02-26T04:54:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6dad0885692f8d1e743873fb4be241f1fd1cb91a'/>
<id>urn:sha1:6dad0885692f8d1e743873fb4be241f1fd1cb91a</id>
<content type='text'>
Float parsing (both single and double precision) may have a relative error
of order the floating point precision, so adjust tests to take this into
account by not printing all of the digits of the answer.
</content>
</entry>
<entry>
<title>py/parsenum: Fix parsing of floats that are close to subnormal.</title>
<updated>2018-02-08T03:02:50+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-02-08T03:02:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b75cb8392bdf5f8c12072eac3adbdaad53d1e8d2'/>
<id>urn:sha1:b75cb8392bdf5f8c12072eac3adbdaad53d1e8d2</id>
<content type='text'>
Prior to this patch, a float literal that was close to subnormal would
have a loss of precision when parsed.  The worst case was something like
float('10000000000000000000e-326') which returned 0.0.
</content>
</entry>
<entry>
<title>py/parsenum: Improve parsing of floating point numbers.</title>
<updated>2017-11-27T01:51:52+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-11-27T01:51:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=84895f1a210d0037a86887f0f647570bdf40afa2'/>
<id>urn:sha1:84895f1a210d0037a86887f0f647570bdf40afa2</id>
<content type='text'>
This patch improves parsing of floating point numbers by converting all the
digits (integer and fractional) together into a number 1 or greater, and
then applying the correct power of 10 at the very end.  In particular the
multiple "multiply by 0.1" operations to build a fraction are now combined
together and applied at the same time as the exponent, at the very end.

This helps to retain precision during parsing of floats, and also includes
a check that the number doesn't overflow during the parsing.  One benefit
is that a float will have the same value no matter where the decimal point
is located, eg 1.23 == 123e-2.
</content>
</entry>
</feed>
