[comp.unix.ultrix] DS3100 C bugs

hoyt@nonvax.alf.dec.com (Kurt Hoyt) (02/27/90)

In article <232@asihub.AUTOSYS.COM> dan@asihub.AUTOSYS.COM (Dan O'Neill) writes:
>Number 1:
> *           Fatal error in: /usr/lib/ugen1.31 Trace/BPT trap

I have submitted the appropriate bug report for you.


>Number 2:
> * Description of problem:
> *      This program executes a divide by zero, but does not generate an
> *      appropriate error message.  An integer value is divided by a
> *      double which contains a zero.  The resulting output is garbage.
> */
>
[Parts of program deleted]
>    printf("result = %x\n", result);

If you change the format specifier to 'f' instead of 'x', you will find that
the bit pattern returned is 'Infinity'. In the man pages, math(3f), it
discusses the IEEE folating point format. In IEEE floating point, division
by zero is NOT an error, but results in the value 'Infinity' being assigned
to your variable. If you want division by zero to cause a SIGFPE, then you need
to set up the floating point control and status register properly. The man
page was left out of the distribution, but the header file is in <mips/fpu.h>.


Kurt Hoyt
Digital Equipment Corporation
hoyt@decatl.alf.dec.com or hoyt@decatl.dec.com or hoyt%decatl@decwrl.dec.com
"Daddy, you not people, you a GUY! Mommy a girl." -- Faith Hoyt

hoyt@nonvax.alf.dec.com (Kurt Hoyt) (02/28/90)

In article <1990Feb27.141713.24611@decatl.dec.com> hoyt@nonvax.alf.dec.com (Kurt Hoyt) writes:
>the bit pattern returned is 'Infinity'. In the man pages, math(3f), it

Make that math(3m), not math(3f).

Kurt Hoyt
Digital Equipment Corporation
hoyt@decatl.alf.dec.com or hoyt@decatl.dec.com or hoyt%decatl@decwrl.dec.com
"Daddy, you not people, you a GUY! Mommy a girl." -- Faith Hoyt