<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 46: Modulo bug due to internal multiplication (from GIMP repo)</title><link href="https://sourceforge.net/p/tinyscheme/bugs/46/" rel="alternate"/><link href="https://sourceforge.net/p/tinyscheme/bugs/46/feed.atom" rel="self"/><id>https://sourceforge.net/p/tinyscheme/bugs/46/</id><updated>2020-09-29T22:18:44.194000Z</updated><subtitle>Recent changes to 46: Modulo bug due to internal multiplication (from GIMP repo)</subtitle><entry><title>#46 Modulo bug due to internal multiplication (from GIMP repo)</title><link href="https://sourceforge.net/p/tinyscheme/bugs/46/?limit=25#0bec" rel="alternate"/><published>2020-09-29T22:18:44.194000Z</published><updated>2020-09-29T22:18:44.194000Z</updated><author><name>Rodion Gorkovenko</name><uri>https://sourceforge.net/u/rodion-gork/</uri></author><id>https://sourceforge.net12756024afdedce195ebd08d752945301657973b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hm. rev77 is where the bug was introduced. Sorry, I poorly explained. Bug is due to overflow in multiplication, which may give negative with two positive numbers, for example.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#46 Modulo bug due to internal multiplication (from GIMP repo)</title><link href="https://sourceforge.net/p/tinyscheme/bugs/46/?limit=25#be7f" rel="alternate"/><published>2020-09-29T22:15:51.070000Z</published><updated>2020-09-29T22:15:51.070000Z</updated><author><name>Rodion Gorkovenko</name><uri>https://sourceforge.net/u/rodion-gork/</uri></author><id>https://sourceforge.netf879146fd898a8eb22f93818dcaa5c9381a308bf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Kevin, sorry, but there is some mystery. I think I see this in current trunk:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sourceforge.net/p/tinyscheme/code/HEAD/tree/trunk/scheme.c#l475"&gt;https://sourceforge.net/p/tinyscheme/code/HEAD/tree/trunk/scheme.c#l475&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#46 Modulo bug due to internal multiplication (from GIMP repo)</title><link href="https://sourceforge.net/p/tinyscheme/bugs/46/?limit=25#7788" rel="alternate"/><published>2020-09-29T19:45:11.703000Z</published><updated>2020-09-29T19:45:11.703000Z</updated><author><name>Kevin Cozens</name><uri>https://sourceforge.net/u/kcozens/</uri></author><id>https://sourceforge.net8ae1072b283c328b4fdd937246d3bd15eebc60f8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You must be using an old version of TinyScheme and/or GIMP. This was fixed in TinyScheme around 9 years ago in r77. The num_mod() routine in both the SF version of TinyScheme and the version included with GIMP are the same. That gitlab commit is wrong in that the R5RS clearly states the sign of the result is the sign of the second operand.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Modulo bug due to internal multiplication (from GIMP repo)</title><link href="https://sourceforge.net/p/tinyscheme/bugs/46/" rel="alternate"/><published>2020-09-29T17:46:55.134000Z</published><updated>2020-09-29T17:46:55.134000Z</updated><author><name>Rodion Gorkovenko</name><uri>https://sourceforge.net/u/rodion-gork/</uri></author><id>https://sourceforge.net186658956399542f6192b75d4a3880c8d1c53774</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Found this fixed in gimp repo, but not here.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;modulo&lt;/code&gt; may give surprising results, e.g. &lt;code&gt;(modulo 3000000000 4000000001)&lt;/code&gt; shows &lt;code&gt;7000000001&lt;/code&gt; (instead of &lt;code&gt;3000000000&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Fix is one-line change:&lt;br/&gt;
&lt;a href="https://gitlab.gnome.org/GNOME/gimp/-/commit/f665e4cfa91facf38970d93f9e8e835e6ea1734d" rel="nofollow"&gt;https://gitlab.gnome.org/GNOME/gimp/-/commit/f665e4cfa91facf38970d93f9e8e835e6ea1734d&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This seems correct, but due to my limited knowledge of scheme I leave it to be counter-checked by some wiser.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>