From: mstensho AT powertech DOT no (Morten Stenshorne) Newsgroups: comp.os.msdos.djgpp Subject: Re: What the $##@$ is going on here!?!?!? Date: Mon, 24 Aug 1998 19:26:51 GMT Organization: Pinkadux sukkerfrie skrusokker Lines: 24 Sender: mstensho AT vangelis DOT dyn DOT ml DOT org Message-ID: References: <6rqttc$dfl AT news1 DOT snet DOT net> Reply-To: mstensho AT powertech DOT no (Morten Stenshorne) NNTP-Posting-Host: s01i21-0052.no.powertech.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In <6rqttc$dfl AT news1 DOT snet DOT net>, "Mark Figura" writes: >var = (color1-color2)/(x1-x2); >If I don't test to make sure that x1 != x2 before I use this equation, my >memory gets all weird or something. (My triangle gets all big and weird >looking). I should get a FPE, shouldn't I, if there's a divide by 0? No, not if you're using floating-point variables - then you'll get Infinity or "Inf", and no exception at all. It's possible to express the Infinity state with floating point variables. However, if you're use integers, you are right - you should get an divide-by-zero exception. Just try this: ----------- double a=5, b=0; double c = a / b; printf("%f\n", c); ----------- It doesn't cause an exception when I run it. -- ---- Morten Stenshorne, Gommerud, 3320 Vestfossen, NORWAY ---- -- mstensho AT powertech DOT no -- http://home.powertech.no/mstensho/ -- ---- Computer Engineer -- Phone: 93440112 -- Doofuz AT IRCNet ----