Path: utzoo!attcan!uunet!mcvax!nikhefh!t68 From: t68@nikhefh.hep.nl (Jos Vermaseren) Newsgroups: comp.lang.fortran Subject: Fortran vs C for computations Message-ID: <535@nikhefh.hep.nl> Date: 5 Sep 88 08:37:27 GMT Organization: Nikhef-H, Amsterdam (the Netherlands). Lines: 23 There is another much more annoying feature of C that restricts its floating point handling to the 'playing only' level. In the second edition of Kernighan and Ritchie it is explained that the standard response of a floating point operation (multiplication, sqrt etc) to an irregularity is returning special values. So float x = -2.0; z = sqrt(x); gives back some value. Amazingly enough many UNIX vendors like this philosophy, so even the UNIX fortran compilers often prefer it this way. If I have to put all kinds of ifs around each floating point operation I'll never do computations in C. The better thing would be to have a parameter that can be set by the user that determines whether an overflow or sqrt of a negative number should be fatal (with intelligent errormeassage please). Most fortran compilers have this option. J.Vermaseren T68@nikhefh.hep.nl