delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/29/15:32:13

From: "A. Sinan Unur" <sinan DOT unur AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: division by 0
Date: Thu, 29 Jan 1998 07:36:23 -0500
Organization: Cornell University (http://www.cornell.edu/)
Lines: 24
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <34D077C7.55500E21@cornell.edu>
References: <34CF2295 DOT 7457 AT quantum DOT de> <#$L$GXFL9GA DOT 231 AT upnetnews02 DOT moswest DOT msn DOT net>
NNTP-Posting-Host: cu-dialup-0028.cit.cornell.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

DeHackEd wrote:
> 
> Why would you want to divide by zero? It's a mathematical no-no, and 
> most computers are less forgiving than most mathematitions (ignore if 
> spelt wrong).

there are valid situations (such as finding the roots of a function,
some optimization algorithms) when you want the program to just take
into account that the operation produced an infinity, and go on.

> This code ALWAYS divides by zero,

i think that wa meant as an illustration only.

by the way, for nonzero x, x/0 is a well defined operation in the
extended reals.
-- 
----------------------------------------------------------------------
A. Sinan Unur
Department of Policy Analysis and Management, College of Human Ecology,
Cornell University, Ithaca, NY 14853, USA

mailto:sinan DOT unur AT cornell DOT edu
http://www.people.cornell.edu/pages/asu1/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019