Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!maverick.ksu.ksu.edu!unmvax!lee From: lee@unmvax.cs.unm.edu (Lee Ward) Newsgroups: comp.sys.next Subject: Re: Bug in NeXT version 2.0 definition of HUGE Keywords: IEEE HUGE Message-ID: <1991Apr30.063619.9973@unmvax.cs.unm.edu> Date: 30 Apr 91 06:36:19 GMT References: <1991Apr30.043810.1597@unmvax.cs.unm.edu> Organization: University of New Mexico Lines: 39 Well, I found just what is generating negative Infinity. It's the bloody compiler! When a number equal to or larger than MAXDOUBLE is presented as a constant it sets the literal to 99e999, a negative number. The definition for HUGE is correct in math.h. I cured this problem by editing pass 1 of the C compiler and C++ compiler. If you want to do this, it goes like this: Do a cc -v and make sure you are using: NeXT Release 2.0 (v31.1) -- GNU version 1.36 If not, don't do this to be on the safe side. become root cd to /lib copy cc1 and cc1++ to some other names. I used cc1.OLD and cc1++.OLD emacs cc1 type ^S (that's control-S) followed by "999". No quotes... Then hit the escape key. You are positioned at the end of one of the nasty literal, "99e999". Now, using the backarrow key place the cursor on the first two nines. Hit delete twice Type "01". Again, no quotes... Hit the downarrow key twice and you are on the line with the other 99e999. Make the same changes here. Now, type ^X^C (control-X then control-C) Do the same thing for cc1++. From now on the compiler will generate HUGE (+Infinity) from for overly large numbers instead of -Infinity. -- --Lee (Ward) ...!unmvax!tochtli!lee is preferred, or lee@unmvax.cs.unm.edu