ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Keith McKay <mckaymeister@gmail.com>
Subject: Re: Arithmetic Overflow error in MetaFun
Date: Sat, 16 May 2020 16:50:13 +0200	[thread overview]
Message-ID: <c9743a71-9c8d-47b5-56c8-b340fdbc6736@xs4all.nl> (raw)
In-Reply-To: <4830f0a0-ece9-53ce-2768-af9110f3962a@gmail.com>

On 5/16/2020 4:36 PM, Keith McKay wrote:
> Colleagues
> 
> I'm having problems with an Arithmetic Overflow error when calculating 
> the x and y values for functions of the form:
> 
> y = ax^4 + bx^3 + cx^2 + dx + e
> 
> to which I then add a bit of randomness and other embellishments. I have 
> had a look in the Metafun and Metafont manuals but nothing jumps out at 
> me. In the minimum working example below, this Arithmetic Overflow 
> occurs when xord =13.5 but I can get the calculation to work if I 
> separate out the equation and then add together, since it seems to be 
> failing on the pow(xord,4) instruction. Is there a switch in MetaFont 
> that should be set or a better way of getting round this Arithmetic 
> Overflow error?

\startMPpage[instance=doublefun]

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      parent reply	other threads:[~2020-05-16 14:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-16 14:36 Keith McKay
2020-05-16 14:48 ` Keith McKay
2020-05-16 19:46   ` Hans Hagen
2020-05-17  8:19     ` Keith McKay
2020-05-16 14:50 ` Hans Hagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c9743a71-9c8d-47b5-56c8-b340fdbc6736@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=mckaymeister@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).