Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Feb 1998 05:51:27 -0800 (PST)
From:      Martin Cracauer <cracauer@FreeBSD.ORG>
To:        Tim.Brown@ctg.com, cracauer@FreeBSD.ORG, freebsd-bugs@FreeBSD.ORG
Subject:   Re: misc/3700
Message-ID:  <199802061351.FAA24990@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
Synopsis: FPE error in "normal" math code

State-Changed-From-To: open-closed
State-Changed-By: cracauer
State-Changed-When: Fri Feb 6 14:43:16 MET 1998
State-Changed-Why: 
I'm not able to reproduce the problem (on 2.2.2). The test program
below runs just fine. To further investigate the problem, we would
need a complete runnable program, so that type declarations aren't
ommited.


#define _ANSI_SOURCE

#include <stdio.h>
#include <math.h>

double testfunc1()
{
  return -216 + 5 * -1315 * 40 / (40 * -1221111);
}

double testfunc2()
{
  return -216.0 + 5.0 * -1315.0 * 40.0 / (40.0 * -1221111.0);
}

int main()
{
  {
    double foo;
    double bar;
    double baz;

    foo = 40.0;
    bar = -.00112334;
    baz = foo * bar;

    printf("%g (%g * %g)\n",baz,foo,bar);
  }

  printf("%g\n",testfunc1());
  printf("%g\n",testfunc2());

  return 0;
}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802061351.FAA24990>