comp.lang.ada
 help / color / mirror / Atom feed
From: "G.B." <bauhaus@futureapps.invalid>
Subject: Re: casting types
Date: Wed, 01 Oct 2014 16:23:13 +0200
Date: 2014-10-01T16:23:13+02:00	[thread overview]
Message-ID: <m0h2oe$5as$1@dont-email.me> (raw)
In-Reply-To: <75969a22-d7f7-4517-9d10-6224beb3318c@googlegroups.com>

On 01.10.14 15:55, Stribor40 wrote:
> I want to be able to represent numbers like 0.1234,-1,2345 and so on so thats why I chose float. Is there any other way i can represent numbers like that? Is there any other data type?
>

Are these rational numbers 0.1234, whole number -1,
and whole number 2345, respectively?

The first falls under either floating point types
or decimal fixed point types, the second is of some
integer type, as is the last one.  You should be
able to learn how you can define just the types
that you need, by using really any text on Ada, no matter
how old.

Frequently, there is no need to use any predefined types.
These may neither reflect your problem well, nor let you
see how to use types. If you follow any tutorial text that
you like, it will let you see what numeric types these are:

    type Part_No is range 1_000 .. 9_999;

    type Bits_16 is mod 2**16;

    type Temperature is delta 0.1 digits 4;

    type Flt is digits 6 range 0.0 .. 42_000_000.0;






  reply	other threads:[~2014-10-01 14:23 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. [this message]
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
replies disabled

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