Re: New number systems compute cyclic path strangely

luigi scarso <[email protected]> Wed, 1 May 2024 21:29:17 +0200
Newsgroups gmane.comp.tex.metapost
Message-ID <CAG5iGsCG_36Rv_qbYTSu0yi5+38ea0k_pTrZPkOrG6qqmgdXyA@mail.gmail.com>
--===============4861002051257566597==
Content-Type: multipart/alternative; boundary="0000000000002655d30617698133"

--0000000000002655d30617698133
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Il Mer 1 Mag 2024, 20:18 Toby Thurston <[email protected]> ha scritto:

>
>
> > On 29 Apr 2024, at 19:11, luigi scarso <[email protected]> wrote:
> >
> >
> > Hm I fear that
> >  @<Update |arc| and |t_tot| after |do_arc_test| has just returned |t|@>=
;
> > implicitly uses the fact that scaled is an integer type, i.e.
> > set_number_from_div (n1, arc, d1); /* n1 =3D (arc / d1) */
> > and
> > number_add (v1, epsilon_t);       /* v1 =3D n1+1 */
> > look suspicious in double mode  ( epsilon_t is not 1 but 2^-52, 1 is
> unity  )
> >
> > --
> > luigi
>
> Surely the comment should be "/* v1 =3D v1 + 1 */" ???
>
> I notice also that the same idiom
>
> `number add(t,epsilon_t);`
>
> is used in =C2=A7414. `mp_solve_rising_cubic` that is used in arc_test, s=
o may
> need to be fixed there as well...
>

Hm, it's always better to have an example that shows the problem...
I have committed r71144  to the texlive repo.

--
luigi

>

--0000000000002655d30617698133
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">Il Mer 1 Mag 2024, 20:18 Toby Thurston &lt;<a href=3D"=
mailto:[email protected]" rel=3D"noreferrer noreferrer" target=3D"_blank">thu=
[email protected]</a>&gt; ha scritto:<br></div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><b=
r>
<br>
&gt; On 29 Apr 2024, at 19:11, luigi scarso &lt;<a href=3D"mailto:luigi.sca=
[email protected]" rel=3D"noreferrer noreferrer noreferrer" target=3D"_blank">l=
[email protected]</a>&gt; wrote:<br>
&gt; <br>
&gt; <br>
&gt; Hm I fear that <br>
&gt;=C2=A0 @&lt;Update |arc| and |t_tot| after |do_arc_test| has just retur=
ned |t|@&gt;;<br>
&gt; implicitly uses the fact that scaled is an integer type, i.e.<br>
&gt; set_number_from_div (n1, arc, d1); /* n1 =3D (arc / d1) */<br>
&gt; and <br>
&gt; number_add (v1, epsilon_t);=C2=A0 =C2=A0 =C2=A0 =C2=A0/* v1 =3D n1+1 *=
/<br>
&gt; look suspicious in double mode=C2=A0 ( epsilon_t is not 1 but 2^-52, 1=
 is unity=C2=A0 )<br>
&gt; <br>
&gt; --<br>
&gt; luigi<br>
<br>
Surely the comment should be &quot;/* v1 =3D v1 + 1 */&quot; ???<br>
<br>
I notice also that the same idiom <br>
<br>
`number add(t,epsilon_t);`<br>
<br>
is used in =C2=A7414. `mp_solve_rising_cubic` that is used in arc_test, so =
may need to be fixed there as well...<br></blockquote></div></div><div dir=
=3D"auto"><br></div><div dir=3D"auto">Hm, it&#39;s always better to have an=
 example that shows the problem...</div><div dir=3D"auto">I have committed =
r71144=C2=A0 to the texlive repo.</div><div dir=3D"auto"><br></div><div dir=
=3D"auto">--</div><div dir=3D"auto">luigi</div><div dir=3D"auto"><div class=
=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div><d=
iv dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> =
</blockquote></div></div></div>

--0000000000002655d30617698133--

--===============4861002051257566597==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--
http://tug.org/metapost/

--===============4861002051257566597==--