[metapost] New number systems compute cyclic path strangely

Toby Thurston thurston at eml.cc
Thu May 2 18:56:12 CEST 2024



> On 1 May 2024, at 20:29, luigi scarso <luigi.scarso at gmail.com> wrote:
> 
> 
> 
> Il Mer 1 Mag 2024, 20:18 Toby Thurston <thurston at eml.cc> ha scritto:
> 
> 
> > On 29 Apr 2024, at 19:11, luigi scarso <luigi.scarso at gmail.com> 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 = (arc / d1) */
> > and 
> > number_add (v1, epsilon_t);       /* v1 = n1+1 */
> > look suspicious in double mode  ( epsilon_t is not 1 but 2^-52, 1 is unity  )
> > 
> > --
> > luigi

I pulled the fix version from your gitlab and built it here.   Looks good now.

toby at Macnab ~/i/mpexx> mpost b.mp
This is MetaPost, version 2.11 (TeX Live 2025/dev) (kpathsea version 6.4.0/dev)
(/usr/local/texlive/2024/texmf-dist/metapost/base/mpost.mp
(/usr/local/texlive/2024/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.005) ) (./b.mp
>> 2799.02077
>> 2.92111
>> 5.92111
>> 3
>> "scaled" [1] )
1 output file written: b.1
Transcript written on b.log.
toby at Macnab ~/i/mpexx> mpost -numbersystem=double b.mp
This is MetaPost, version 2.11 (TeX Live 2025/dev) (kpathsea version 6.4.0/dev)
(/usr/local/texlive/2024/texmf-dist/metapost/base/mpost.mp
(/usr/local/texlive/2024/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.005) ) (./b.mp
>> 2799.0210591829564
>> 2.9211035593209118
>> 5.9211035593209118
>> 3
>> "double" [1] )
1 output file written: b.1
Transcript written on b.log.

Thanks for fixing this so quickly.  Toby


More information about the metapost mailing list.