[metapost] New number systems compute cyclic path strangely

Toby Thurston thurston at eml.cc
Wed May 1 20:18:21 CEST 2024



> 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

Surely the comment should be "/* v1 = v1 + 1 */" ???

I notice also that the same idiom 

`number add(t,epsilon_t);`

is used in §414. `mp_solve_rising_cubic` that is used in arc_test, so may need to be fixed there as well...

Toby 


More information about the metapost mailing list.