<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/parsenum.c, branch 4.0.0-beta.7</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=4.0.0-beta.7</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=4.0.0-beta.7'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2018-08-17T00:40:57+00:00</updated>
<entry>
<title>Compress all translated strings with Huffman coding.</title>
<updated>2018-08-17T00:40:57+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2018-08-16T01:32:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=de5a9d72dcdaacdd5048195cd5bab007f4b2baef'/>
<id>urn:sha1:de5a9d72dcdaacdd5048195cd5bab007f4b2baef</id>
<content type='text'>
This saves code space in builds which use link-time optimization.
The optimization drops the untranslated strings and replaces them
with a compressed_string_t struct. It can then be decompressed to
a c string.

Builds without LTO work as well but include both untranslated
strings and compressed strings.

This work could be expanded to include QSTRs and loaded strings if
a compress method is added to C. Its tracked in #531.
</content>
</entry>
<entry>
<title>Two fixes and translate more strings.</title>
<updated>2018-08-09T20:29:30+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2018-08-09T01:24:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=96ebf5bc3fb455162286b9bc31e763f3c4f1c457'/>
<id>urn:sha1:96ebf5bc3fb455162286b9bc31e763f3c4f1c457</id>
<content type='text'>
* Fix finding translations with escaped characters.
* Add back \r to translations since its needed by screen.
</content>
</entry>
<entry>
<title>WIP: after merge; before testing</title>
<updated>2018-07-11T20:45:30+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2018-07-11T20:45:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7c219600a246d8956d0b23ea3f5d125a820e6b6a'/>
<id>urn:sha1:7c219600a246d8956d0b23ea3f5d125a820e6b6a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/lexer: Add support for underscores in numeric literals.</title>
<updated>2018-06-12T02:17:43+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-06-01T14:21:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6a445b60fad87c94a1d00ce3a043b881a1f7a5a4'/>
<id>urn:sha1:6a445b60fad87c94a1d00ce3a043b881a1f7a5a4</id>
<content type='text'>
This is a very convenient feature introduced in Python 3.6 by PEP 515.
</content>
</entry>
<entry>
<title>py/parsenum: Adjust braces so they are balanced.</title>
<updated>2018-05-22T03:20:00+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-05-22T03:20:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=f2ec7925542e5a75b2da7ef378f5df66fdb6fad9'/>
<id>urn:sha1:f2ec7925542e5a75b2da7ef378f5df66fdb6fad9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/parsenum: Avoid undefined behavior parsing floats with large exponents.</title>
<updated>2018-05-21T02:37:57+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2018-05-19T15:56:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4f71a2a75a71b89dad2eed147d6e237b633b878e'/>
<id>urn:sha1:4f71a2a75a71b89dad2eed147d6e237b633b878e</id>
<content type='text'>
Fuzz testing combined with the undefined behavior sanitizer found that
parsing unreasonable float literals like 1e+9999999999999 resulted in
undefined behavior due to overflow in signed integer arithmetic, and a
wrong result being returned.
</content>
</entry>
<entry>
<title>py/parsenum: Use int instead of mp_int_t for parsing float exponent.</title>
<updated>2018-05-21T02:27:38+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-05-21T02:27:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5efc575067df17be785d2b60124706d789d6cfe0'/>
<id>urn:sha1:5efc575067df17be785d2b60124706d789d6cfe0</id>
<content type='text'>
There is no need to use the mp_int_t type which may be 64-bits wide, there
is enough bit-width in a normal int to parse reasonable exponents.  Using
int helps to reduce code size for 64-bit ports, especially nan-boxing
builds.  (Similarly for the "dig" variable which is now an unsigned int.)
</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>
<entry>
<title>Initial merge of micropython v1.9.2 into circuitpython 2.0.0 (in development) master.</title>
<updated>2017-08-26T02:17:07+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2017-08-26T02:17:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ef61b5ecb59e9b4e37e3e3c023c62d583c23eb16'/>
<id>urn:sha1:ef61b5ecb59e9b4e37e3e3c023c62d583c23eb16</id>
<content type='text'>
cpx build compiles and loads and works in repl; test suite not run yet
esp8266 not tested yet
</content>
</entry>
</feed>
