comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com
Subject: School Assignment--Can this be simplified?
Date: 2000/08/30
Date: 2000-08-30T00:00:00+00:00	[thread overview]
Message-ID: <n5er5.146349$i5.2175806@news1.frmt1.sfba.home.com> (raw)
In-Reply-To: 39AD5DBD.972C97CA@brandonsd.mb.ca

>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).




  parent reply	other threads:[~2000-08-30  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-30  0:00 School Assignment--Can this be simplified? N J Chackowsky
2000-08-30  0:00 ` Pascal Obry
2000-08-30  0:00 ` Keith Thompson
2000-08-30  0:00 ` tmoran [this message]
2000-08-31  0:00 ` Martin Dowie
2000-08-31 11:31   ` Simon Wright
2000-08-31 11:51     ` Martin Dowie
2000-08-31 18:35   ` N J Chackowsky
2000-08-31 19:19     ` N J Chackowsky
2000-08-31 19:33       ` Pascal Obry
2000-08-31 23:03         ` Nick J Chackowsky
2000-09-01  1:02         ` tmoran
2000-09-01  4:14           ` Robert Dewar
2000-09-01 17:51             ` tmoran
2000-09-02  3:12               ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox