From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ba9a717d172afa4f X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: School Assignment--Can this be simplified? Date: 2000/08/30 Message-ID: #1/1 X-Deja-AN: 664473127 References: <39AD5DBD.972C97CA@brandonsd.mb.ca> X-Complaints-To: abuse@home.net X-Trace: news1.frmt1.sfba.home.com 967667155 24.20.190.201 (Wed, 30 Aug 2000 13:25:55 PDT) Organization: @Home Network NNTP-Posting-Date: Wed, 30 Aug 2000 13:25:55 PDT Newsgroups: comp.lang.ada Date: 2000-08-30T00:00:00+00:00 List-Id: >Question: Why do I need the double( ) around the expression >-5438.0/dewk+21.72, but not around the literal 2.7183? Because the expression is of type "float" (from dewk or tempk) and your "Pow" function presumably wants a "double" for the second parameter. Your first parameter is a numeric literal, so it would serve OK as either a float or a double. Why do you need double precision in a calculation of vapor pressure? Is this in the interior of neutron star or something? ;) Especially when e as given is accurate to only 4 places. If the standard Float is not adequate, and you don't want to use an explicit declaration like "type Real is digits 11;" and instantiate the needed generics, then check if your compiler supports the predefined type Long_Float and matching package Ada.Numerics.Long_Elementary_Functions. >The trouble is, I need to use the Pow function, so I need with >ada.numerics.aux. Does this look about right, and could it be >simplified. It would be simpler to use the standard Exp(x) function than the non-standard Pow(2.7183,x).