comp.lang.ada
 help / color / mirror / Atom feed
From: brbarkstrom@gmail.com
Subject: Re: casting types
Date: Mon, 6 Oct 2014 17:21:54 -0700 (PDT)
Date: 2014-10-06T17:21:54-07:00	[thread overview]
Message-ID: <d380fdc3-a174-4453-9304-e28bc225de7f@googlegroups.com> (raw)
In-Reply-To: <m0vakt$l53$1@dont-email.me>

On Monday, October 6, 2014 8:03:44 PM UTC-4, Jeffrey Carter wrote:
> On 10/06/2014 04:36 PM, brbarkstrom@gmail.com wrote:
> 
> > 
> 
> > First, to be safe in doing any floating point arithmetic, you should
> 
> > use the Ada type long_float.
> 
> 
> 
> No, you shouldn't. First, Long_Float is optional; there is no guarantee that a
> 
> compiler implements it, so if you want your code to be portable you'll avoid it.
> 
> Even if it is defined, it need not be any different from Float. Second, given
> 
> that McCormick identified modeling scalars (using user-defined numeric and
> 
> enumeration types) as the main Ada feature that allowed his students to be
> 
> successful, advice to always use a predefined type should rightly be regarded
> 
> with suspicion.
> 
> 
> 
> If you have an application that needs the maximum precision the compiler can
> 
> give you, you should define a floating-point type using System.Max_Digits.
> 
> 
> 
> >    return (Result);
> 
> 
> 
> There is no need for parentheses here.
> 
> 
> 
> -- 
> 
> Jeff Carter
> 
> "I was hobbling along, minding my own business, all of a
> 
> sudden, up he comes, cures me! One minute I'm a leper with
> 
> a trade, next minute my livelihood's gone! Not so much as a
> 
> 'by your leave!' You're cured, mate. Bloody do-gooder!"
> 
> Monty Python's Life of Brian
> 
> 76
Thanks for the correction.

      reply	other threads:[~2014-10-07  0:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01  1:49 casting types Stribor40
2014-10-01  2:06 ` Jeffrey Carter
2014-10-01  2:13   ` Stribor40
2014-10-01  2:56   ` Stribor40
2014-10-01 13:18     ` Dennis Lee Bieber
2014-10-01 13:55       ` Stribor40
2014-10-01 14:23         ` G.B.
2014-10-01 17:16           ` Stribor40
2014-10-01 17:38             ` Dirk Heinrichs
2014-10-02  1:47               ` Dennis Lee Bieber
2014-10-01 18:11         ` Jeffrey Carter
2014-10-02  9:21         ` Brian Drummond
2014-10-02  9:24     ` Brian Drummond
2014-10-03  3:35       ` Stribor40
2014-10-03  7:45         ` Björn Lundin
2014-10-03  8:29         ` Jacob Sparre Andersen
2014-10-06 23:36           ` brbarkstrom
2014-10-07  0:03             ` Jeffrey Carter
2014-10-07  0:21               ` brbarkstrom [this message]
replies disabled

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