Re: metapost Digest, Vol 159, Issue 1

"Daniel H. Luecking" <[email protected]> Wed, 29 Jan 2020 18:11:39 +0000
Newsgroups gmane.comp.tex.metapost
Message-ID <BN6PR04MB1029EDABCF8BA4CAA6F9C0F5B9050@BN6PR04MB1029.namprd04.prod.outlook.com>
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 [[email protected]]
Department of Mathematical Sciences
1 University of Arkansas
Fayetteville, AR, USA 72701-1201
________________________________
From: metapost <[email protected]> on behalf of Toby Thurston <[email protected]>
Sent: Wednesday, January 29, 2020 5:06 AM
To: [email protected] <[email protected]>
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, [email protected] wrote:
> Send metapost mailing list submissions to
>        [email protected]
>
> 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
>        [email protected]
>
> You can reach the person managing the list at
>        [email protected]
>
> 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 <[email protected]>
> To: Metapost List <[email protected]>
> Subject: [metapost] roundd function
> Message-ID:
>        <CAKfz9bC994uhVjw=k_pjwtiCsVbvGC7BMvwCHvkesk9Xb-11Zg@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
> [email protected]
> 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
  [email protected]
--
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=

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