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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.93.38 with SMTP id k26mr15195686yhf.20.1399299763515; Mon, 05 May 2014 07:22:43 -0700 (PDT) X-Received: by 10.182.22.138 with SMTP id d10mr201674obf.7.1399299763324; Mon, 05 May 2014 07:22:43 -0700 (PDT) Path: border1.nntp.dca.giganews.com!nntp.giganews.com!hw13no483517qab.0!news-out.google.com!gi6ni747igc.0!nntp.google.com!r10no855198igi.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 5 May 2014 07:22:43 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=174.24.98.194; posting-account=X7Y-0AoAAABSgWfgVpaegSDud7e4NIYx NNTP-Posting-Host: 174.24.98.194 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9ac10bab-2ade-4ac8-a99b-336595e38f67@googlegroups.com> Subject: Noob question.. Autopromotion? From: sdalemorrey@gmail.com Injection-Date: Mon, 05 May 2014 14:22:43 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.dca.giganews.com comp.lang.ada:186240 Date: 2014-05-05T07:22:43-07:00 List-Id: Hello, I've been reading this... www.adacore.com/uploads_gems/Ada_for_the_C++_or_Java_Developer-cc.pdf On page 14 it says... "In Ada, a floating point literal must be written with both an integral and= decimal part. 10 is not a valid literal for a floating point value, while= 10.0 is." In my use case I will have users entering values (likely to be whole intege= rs) and these will be multiplied by the price. For example... Buy 100 USD @ 1.1 CAD However there is also the market order where the person will be buying or s= elling at best available price and then we have to report the average price= paid. 110 CAD / 100 USD So the question is, if I use some sort of floating point type for all 3 val= ues, what's going to happen during assignment? I can't necessarily check u= ser input ahead of time and force them to input 100.00, so is there a way t= o autopromote the values? Thanks!