Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Feb 1998 19:24:06 -0800 (PST)
From:      Thomas Dean <tomdean@ix.netcom.com>
To:        bartol@salk.edu
Cc:        freebsd-questions@FreeBSD.ORG, mika@sdna2.ucsd.edu
Subject:   Re: IEEE Floating Point question: Inf and NaN
Message-ID:  <199802030324.TAA20244@ix.netcom.com>
In-Reply-To: <Pine.BSF.3.96.980202161523.23575G-100000@dale.salk.edu> (message from Tom Bartol on Mon, 2 Feb 1998 16:33:30 -0800 (PST))

next in thread | previous in thread | raw e-mail | index | archive | help
What are you using to compile your code?
What version of FreeBSD are you running?
What is your cpu?

I tried:

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

main()
{
  double x, y, z;

  x = 1.0;
  y = 0.0;
  z = x/y;
  printf("1/0 z = %f\n",z);

  x = 0.0;
  y = 0.0;
  z = x/y;
  printf("0/0 z = %f\n",z);
}

cc -O2 -m486 -pipe  xx.c  -o xx

xx
1/0 z = Inf
0/0 z = NaN

cc -v
gcc version 2.7.2.1
uname -a
FreeBSD celebris 3.0-CURRENT FreeBSD 3.0-CURRENT #0: \
     Sun Feb  1 19:58:49 PST 1998 \
     root@celebris:/usr/src/sys/compile/CELEBRIS-SMP  i386




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