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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: casting types Date: Wed, 01 Oct 2014 16:23:13 +0200 Organization: A noiseless patient Spider Message-ID: References: <75969a22-d7f7-4517-9d10-6224beb3318c@googlegroups.com> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 1 Oct 2014 14:23:10 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="5468"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18g2VNi0X/F96mYT1mbs+lNejZmnDOodGQ=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <75969a22-d7f7-4517-9d10-6224beb3318c@googlegroups.com> Cancel-Lock: sha1:Yk6l4KSklYVrcZhk3hZG0VIFb3k= Xref: number.nntp.giganews.com comp.lang.ada:189278 Date: 2014-10-01T16:23:13+02:00 List-Id: 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;