comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Game Programming / Graphics
Date: Sun, 3 Apr 2005 10:53:01 +0200
Date: 2005-04-03T10:52:54+02:00	[thread overview]
Message-ID: <271ug8iv5jlv.1fh0nt13vc9t7$.dlg@40tude.net> (raw)
In-Reply-To: 1112471680.276284.42140@o13g2000cwo.googlegroups.com

On 2 Apr 2005 11:54:40 -0800, jsnX wrote:

> What is Ada's numerics model like? I've
> heard that it's better than C++'s, but I haven't seen any specifics.

The main difference is that in C++ you specify what your computer has. In
Ada you do what you nee:

// C++
double X; 

-- Ada
type Something is digits 8 range 0.0..100_000.0;
X : Something;

I.e. Ada's numerics are based on a contract model. Ada's numerics are true
types. You can have different numeric types and the compiler will prevent
you from mixing them, if you do not define corresponding operations. As
types they may have constrained subtypes with range checks enforced. Other
differences are that Ada has fixed point binary and decimal numbers
additionally to the floating-point ones.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  parent reply	other threads:[~2005-04-03  8:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-02 19:54 Game Programming / Graphics jsnX
2005-04-02 22:35 ` Luke A. Guest
2005-04-03 15:01   ` jsnX
2005-04-03 16:51     ` Luke A. Guest
2005-04-03 17:18       ` jsnX
2005-04-03 17:25         ` Leif Roar Moldskred
2005-04-03 18:37     ` beliavsky
2005-04-13 22:15     ` Lionel Draghi
2005-04-26  1:37       ` adaworks
2005-04-26 17:50         ` Dr. Adrian Wrigley
2005-04-03  8:53 ` Dmitry A. Kazakov [this message]
2005-04-03 14:52   ` jsnX
2005-04-03 15:51     ` Pascal Obry
2005-04-03 17:23       ` jsnX
2005-04-03 18:19         ` Pascal Obry
2005-04-03 16:10     ` Dmitry A. Kazakov
2005-04-10 10:05 ` step_y
replies disabled

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