[metapost] metapost Digest, Vol 159, Issue 1

Daniel H. Luecking luecking at uark.edu
Wed Jan 29 19:11:39 CET 2020


Walter,

I suspect that the problem is due to the fact that most fractions
of the form k/10000 cannot be represented exactly in binary, the
internal formal used by metapost. And ever if it were, most
binary representations cannot be expressed exactly in only 4
decimal digits.

Cheers, Dan

P.S. For best help, a self-contained test.mp should be provided.

Daniel H. Luecking [luecking at uark.edu]
Department of Mathematical Sciences
1 University of Arkansas
Fayetteville, AR, USA 72701-1201
________________________________
From: metapost <metapost-bounces+luecking=uark.edu at tug.org> on behalf of Toby Thurston <thurston at eml.cc>
Sent: Wednesday, January 29, 2020 5:06 AM
To: metapost at tug.org <metapost at tug.org>
Subject: Re: [metapost] metapost Digest, Vol 159, Issue 1

what is the definition of the roundd function?  it is not part of plain.mp, so I guess it is defined in format.mp that you are importing.  Looks like you will need to update it to work properly with the new number systems..

On Wed, 29 Jan 2020, at 11:00, metapost-request at tug.org wrote:
> Send metapost mailing list submissions to
>        metapost at tug.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        https://urldefense.proofpoint.com/v2/url?u=https-3A__tug.org_mailman_listinfo_metapost&d=DwICAg&c=7ypwAowFJ8v-mw8AB-SdSueVQgSDL4HiiSaLK01W8HA&r=TC6doj34eEZMeTCOMVYeIK4ttwYpTurqDpMOi43sP18&m=93y_zMhfjS7TOChma91ZDqBtWVmaK_M7ebnR4vTQlUc&s=4E-YOigyAZnEHikLv7IP2jlkMb0P1Nerntofzz2d26M&e=
> or, via email, send a message with subject or body 'help' to
>        metapost-request at tug.org
>
> You can reach the person managing the list at
>        metapost-owner at tug.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of metapost digest..."
>
>
> Today's Topics:
>
>    1. roundd function (Walt Burkhard)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 28 Jan 2020 22:38:28 -0800
> From: Walt Burkhard <burkhard at cs.ucsd.edu>
> To: Metapost List <metapost at tug.org>
> Subject: [metapost] roundd function
> Message-ID:
>        <CAKfz9bC994uhVjw=k_pjwtiCsVbvGC7BMvwCHvkesk9Xb-11Zg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello,
> I have occasion to use roundd with the numbersystem=double,
> unfortunately this seems to not work correctly.   All seems to be
> okay in the default number system!
>
> I have attached the test program  and show its output here.
>
> default number system:
> 123.5679
> 123.5679
> double number system
> 123.56789999999999
> 123.56789999999999
>
> Is there any (easy) fix for this behavior?/
>
> Many thanks in advance.
>
> Walt Burkhard
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__tug.org_pipermail_metapost_attachments_20200128_628624ea_attachment-2D0001.html&d=DwICAg&c=7ypwAowFJ8v-mw8AB-SdSueVQgSDL4HiiSaLK01W8HA&r=TC6doj34eEZMeTCOMVYeIK4ttwYpTurqDpMOi43sP18&m=93y_zMhfjS7TOChma91ZDqBtWVmaK_M7ebnR4vTQlUc&s=kUmpqzwHmZuANGpPBpAxHIqfyGPLYpu7cbhMvgep2Ok&e= >
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: test.mp
> Type: application/octet-stream
> Size: 266 bytes
> Desc: not available
> URL:
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__tug.org_pipermail_metapost_attachments_20200128_628624ea_attachment-2D0001.obj&d=DwICAg&c=7ypwAowFJ8v-mw8AB-SdSueVQgSDL4HiiSaLK01W8HA&r=TC6doj34eEZMeTCOMVYeIK4ttwYpTurqDpMOi43sP18&m=93y_zMhfjS7TOChma91ZDqBtWVmaK_M7ebnR4vTQlUc&s=lvQIrRwmO9PeLf9-B59r9bfktwfYZgrq6njqkWIyCeM&e= >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> metapost mailing list
> metapost at tug.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__tug.org_mailman_listinfo_metapost&d=DwICAg&c=7ypwAowFJ8v-mw8AB-SdSueVQgSDL4HiiSaLK01W8HA&r=TC6doj34eEZMeTCOMVYeIK4ttwYpTurqDpMOi43sP18&m=93y_zMhfjS7TOChma91ZDqBtWVmaK_M7ebnR4vTQlUc&s=4E-YOigyAZnEHikLv7IP2jlkMb0P1Nerntofzz2d26M&e=
>
>
> ------------------------------
>
> End of metapost Digest, Vol 159, Issue 1
> ****************************************
>

--
  Toby Thurston
  thurston at eml.cc
--
https://urldefense.proofpoint.com/v2/url?u=http-3A__tug.org_metapost_&d=DwICAg&c=7ypwAowFJ8v-mw8AB-SdSueVQgSDL4HiiSaLK01W8HA&r=TC6doj34eEZMeTCOMVYeIK4ttwYpTurqDpMOi43sP18&m=93y_zMhfjS7TOChma91ZDqBtWVmaK_M7ebnR4vTQlUc&s=JkDsKHAZImLIPbxvkZTzg-vQ4FRqa_0qYNgSMxh3szo&e=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/metapost/attachments/20200129/a8c77410/attachment.html>


More information about the metapost mailing list.