Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!gatech!bloom-beacon!husc6!mit-eddie!ll-xn!ames!sdcsvax!ucbvax!siri.uio.no!ik.naggum-erik From: ik.naggum-erik@siri.uio.no Newsgroups: comp.os.vms Subject: Re: C help Message-ID: <6129.8707122222@verdande.UIO.NO> Date: Wed, 15-Jul-87 10:59:14 EDT Article-I.D.: verdande.6129.8707122222 Posted: Wed Jul 15 10:59:14 1987 Date-Received: Fri, 17-Jul-87 06:02:31 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 46 "The best way to predict the future is to invent it." (EVB S/W Eng, Inc.) Message-ID: <12317866627.139.IK.NAGGUM-ERIK@SIRI> Yates@a.chem.upenn.edu writes: > C makes me nervous! Below is an example of the dangers involved with > Floating point square roots. Is something wrong here or does one just > have to be extremely careful in C with: ...... > Is there a bug here or is it just that C must never, ever be treated > as a high level language for floating point operations? ...... > $! The following logicals allow /G_Float qualifier to be used > $! with the CC command and Curses (a screen management package) > $! according to the C manual, anyway ...... > Is it any wonder I keep putting away my K and R? John John, I regard myself as an expert in C and Unix. I have read the Ansi Standard Draft of 10/10/86, and Kernighan and Richie: The C Programming Language. With 3 years of experience in C programming, and 200K source lines on my conscience, I have some comments to your article, blaming C for various flaws in floating point operations on a VAX (model X?), using VAX C version 2.2 under VMS. I took the time to go through a lot of documentation tonight, and visited those for (AT&T) Unix Version 7, System III and System V, for SVID, for BSD release 4.3 and Ultrix 2.0, for XENIX 3 and XENIX 5, and finally those of SUN OS. (Insert list of trademark owners here.) Nowhere can I find a reference to G-floating or, in fact, any other specific implementation of floating point numbers, as part of the C language. Rather, I have found that each machine and each implementor decides which formats to use, and that they are more an attribute of the hardware than of the language definition. You ask, > Is it any wonder I keep putting away my K and R? Why not put away your VAX VMS or your VAX C, instead? Erik Naggum ARPA: enag@siri.uio.no or enag%siri@ifi.uio.no Manager SNAIL: POB 1560 Vika, N-0118 OSLO 1, NORWAY Naggum Software PHONE: (intl)+47-2-549-163 (0600-1200 GMT) -------