<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/mpz.c, branch 0.9.4</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=0.9.4</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=0.9.4'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-12-28T01:04:19+00:00</updated>
<entry>
<title>py/mpz: Fix assertion in mpz_set_from_str which checks value of base.</title>
<updated>2016-12-28T01:04:19+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-28T01:04:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2d9440e2d18775636cf6cfafe1aa1440b21d026b'/>
<id>urn:sha1:2d9440e2d18775636cf6cfafe1aa1440b21d026b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/mpz: Remove unreachable code in mpn_or_neg functions.</title>
<updated>2016-12-13T23:39:41+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-13T23:39:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e83f140463f2144b84e2fe4fa249ab8c8426b5e9'/>
<id>urn:sha1:e83f140463f2144b84e2fe4fa249ab8c8426b5e9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: fix null pointer dereference in mpz.c, fix missing va_end in warning.c</title>
<updated>2016-10-31T20:21:15+00:00</updated>
<author>
<name>Pavol Rusnak</name>
<email>stick@gk2.sk</email>
</author>
<published>2016-10-25T09:03:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=3679ee9b520db96772ef0917d0a108180aa70114'/>
<id>urn:sha1:3679ee9b520db96772ef0917d0a108180aa70114</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Factor duplicated function to calculate size of formatted int.</title>
<updated>2016-10-11T02:11:32+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-10-11T02:11:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8bb7d958f173eec58892bc00115516c160f93243'/>
<id>urn:sha1:8bb7d958f173eec58892bc00115516c160f93243</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/mpz: Use assert to verify mpz does not have a fixed digit buffer.</title>
<updated>2016-10-11T02:00:56+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-10-11T02:00:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=df3e5d2b2f8610d246fea348bb96e70f636183ea'/>
<id>urn:sha1:df3e5d2b2f8610d246fea348bb96e70f636183ea</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/mpz: In divmod, replace check for rhs!=0 with assert.</title>
<updated>2016-10-11T02:00:01+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-10-11T02:00:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=48874942f0e0c948a9cb351b25d9fb04cdb82d56'/>
<id>urn:sha1:48874942f0e0c948a9cb351b25d9fb04cdb82d56</id>
<content type='text'>
The check for division by zero is made by the caller of this function.
</content>
</entry>
<entry>
<title>py/mpz: Fix mpn_div so that it doesn't modify memory of denominator.</title>
<updated>2016-05-09T16:21:42+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-09T16:21:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=460b0863334fb143667ae6aa1b5f0bd2bbdf8282'/>
<id>urn:sha1:460b0863334fb143667ae6aa1b5f0bd2bbdf8282</id>
<content type='text'>
Previous to this patch bignum division and modulo would temporarily
modify the RHS argument to the operation (eg x/y would modify y), but on
return the RHS would be restored to its original value.  This is not
allowed because arguments to binary operations are const, and in
particular might live in ROM.  The modification was to normalise the arg
(and then unnormalise before returning), and this patch makes it so the
normalisation is done on the fly and the arg is now accessed as read-only.

This change doesn't increase the order complexity of the operation, and
actually reduces code size.
</content>
</entry>
<entry>
<title>py/mpz: Do Python style division/modulo within bignum divmod routine.</title>
<updated>2016-05-08T21:21:21+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-08T21:21:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=65402ab1ec05fd552ceae63e2dcac69095ab1338'/>
<id>urn:sha1:65402ab1ec05fd552ceae63e2dcac69095ab1338</id>
<content type='text'>
This patch consolidates the Python logic for division/modulo to one place
within the bignum code.
</content>
</entry>
<entry>
<title>py/mpz: Fix bug with overflowing C-shift in division routine.</title>
<updated>2016-05-08T20:38:43+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-08T20:38:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=dc3faea0405dea803828f5a2be314734b8c166b6'/>
<id>urn:sha1:dc3faea0405dea803828f5a2be314734b8c166b6</id>
<content type='text'>
When DIG_SIZE=32, a uint32_t is used to store limbs, and no normalisation
is needed because the MSB is already set, then there will be left and
right shifts (in C) by 32 of a 32-bit variable, leading to undefined
behaviour.  This patch fixes this bug.
</content>
</entry>
<entry>
<title>py/mpz: Add commented-out mpz_pow3_inpl function, to compute (x**y)%z.</title>
<updated>2016-02-03T22:30:49+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-02-03T22:30:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ff1a96ce2cd95c42beca5209b353f83da773522d'/>
<id>urn:sha1:ff1a96ce2cd95c42beca5209b353f83da773522d</id>
<content type='text'>
This function computes (x**y)%z in an efficient way.  For large arguments
this operation is otherwise not computable by doing x**y and then %z.

It's currently not used, but is added in case it's useful one day.
</content>
</entry>
</feed>
