Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!ames!haven!ncifcrf!nlm-mcs!adm!smoke!gwyn From: gwyn@smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: should double have better precision or greater range? Message-ID: <8447@smoke.ARPA> Date: 7 Sep 88 06:42:45 GMT References: <8809061831.AA29128@ucbvax.Berkeley.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 20 In article <8809061831.AA29128@ucbvax.Berkeley.EDU> U23405@UICVM (Michael J. Steiner) writes: >I may go as far as to say that there should be two kinds of doubles, one >with better precision and another with greater range. The whole business of specifying detailed attributes of data types in a C-like language is something that should be totally reworked, rather than patched. >Also, I recently heard of a "long double". Since double is defined as >"long float", this would mean "long long float", which is confusing. "long float" is out; if you've been using this, you're advised to change it to "double" before you bump into a compiler that doesn't recognize "long float". "long double" is new with ANSI C. >One last thing: Would an expression be evaluated more quickly if the RHS >had variables of type short or type int? That depends on the implementation. "int" is usually the fastest data type, but not always. Just express the computation correctly and let the compiler worry about such micro-optimization.