<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/mpz.c, branch v1.8.5</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.8.5</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.8.5'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-10-11T02:11:32+00:00</updated>
<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>
<entry>
<title>py/mpz: Complete implementation of mpz_{and,or,xor} for negative args.</title>
<updated>2016-02-03T22:13:39+00:00</updated>
<author>
<name>Doug Currie</name>
<email>github.9.eeeeeee@spamgourmet.com</email>
</author>
<published>2016-01-31T03:35:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2e2e15cec2f85ece763f3f80152d759aecfad47c'/>
<id>urn:sha1:2e2e15cec2f85ece763f3f80152d759aecfad47c</id>
<content type='text'>
For these 3 bitwise operations there are now fast functions for
positive-only arguments, and general functions for arbitrary sign
arguments (the fast functions are the existing implementation).

By default the fast functions are not used (to save space) and instead
the general functions are used for all operations.

Enable MICROPY_OPT_MPZ_BITWISE to use the fast functions for positive
arguments.
</content>
</entry>
<entry>
<title>py/mpz: Fix conversion of float to mpz so it works on big endian archs.</title>
<updated>2016-01-08T17:56:58+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-08T17:56:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2adf7ec3dd4da9188be60e9536b401ab99189558'/>
<id>urn:sha1:2adf7ec3dd4da9188be60e9536b401ab99189558</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/mpz: Normalize (remove leading zeros) xor operation result.</title>
<updated>2015-11-22T20:03:18+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-11-22T20:03:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b3be4710aaa53429c78d03a86e9be909dca923c0'/>
<id>urn:sha1:b3be4710aaa53429c78d03a86e9be909dca923c0</id>
<content type='text'>
</content>
</entry>
</feed>
