Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bfmny0!tneff From: tneff@bfmny0.UU.NET (Tom Neff) Newsgroups: comp.lang.perl Subject: Re: Bad ulong cast on 80x86/87 machines Message-ID: <15338@bfmny0.UU.NET> Date: 8 Apr 90 04:27:50 GMT References: <15335@bfmny0.UU.NET> Reply-To: tneff@bfmny0.UU.NET (Tom Neff) Lines: 22 I included the wrong patch for util.c in the referenced article. Sorry! Try this. *** /tmp/,RCSt1a02173 Sun Apr 8 00:26:17 1990 --- /tmp/,RCSt2a02173 Sun Apr 8 00:26:18 1990 *************** *** 1332,1337 **** --- 1341,1354 ---- double f; { long along; + + #define ulmax ((unsigned long) -1) + + double longmax = (ulmax/2)+1; + /* this should express LONG_MAX */ + + if (f >= longmax) + return (unsigned long)(f - ulmax - 1); if (f >= 0.0) return (unsigned long)f;