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 X-Google-Thread: 103376,c3768896d3e82ec X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Game Programming / Graphics Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1112471680.276284.42140@o13g2000cwo.googlegroups.com> <271ug8iv5jlv.1fh0nt13vc9t7$.dlg@40tude.net> <1112539926.068726.93830@z14g2000cwz.googlegroups.com> Date: Sun, 3 Apr 2005 18:10:12 +0200 Message-ID: NNTP-Posting-Date: 03 Apr 2005 18:10:05 MEST NNTP-Posting-Host: 2e8082dc.newsread4.arcor-online.net X-Trace: DXC=9LFE2XSnFBM4mA>;52^R7K:ejgIfPPldDjW\KbG]kaMHFYk:AnJB[CM>\QCE?GV9>H[6LHn;2LCVNCOgUkn_?_YOm>?=QSC`7OE X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:10259 Date: 2005-04-03T18:10:05+02:00 List-Id: On 3 Apr 2005 07:52:06 -0700, jsnX wrote: >> 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. > > sounds pretty neat, but is it computationally expensive? if i write > numeric stuff in Ada (vector operations, special functions, physics > stuff) will it be in general: > a) slower than the same stuff written in good (templated) C++ > b) faster than the same stuff written in good (templated) C++ > c) hard to say - sometimes faster, sometimes slower > d) hard to say - depends heavily on compiler > e) other - please write in If you are going to use floating-point numbers, then I can't see any reason why it should be either faster or slower. Most likely all computations will be made in the machine type that fits at most. Portability is an advantage, though portable error handling can still be tricky. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de