DS3100 C bugs

Kurt Hoyt hoyt at nonvax.alf.dec.com
Wed Feb 28 01:17:13 AEST 1990


In article <232 at asihub.AUTOSYS.COM> dan at 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 at decatl.alf.dec.com or hoyt at decatl.dec.com or hoyt%decatl at decwrl.dec.com
"Daddy, you not people, you a GUY! Mommy a girl." -- Faith Hoyt



More information about the Comp.unix.ultrix mailing list