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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: A curiosity about decimal fixed point types... Date: Tue, 12 Nov 2013 13:31:53 +0100 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: <87vbzxg5s6.fsf@adaheads.sparre-andersen.dk> References: <7d4f2e0c-0aed-4ba3-aa5a-0c2bc0c2c5a0@googlegroups.com> NNTP-Posting-Host: monowall.adaheads.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: loke.gir.dk 1384259513 5187 86.48.41.195 (12 Nov 2013 12:31:53 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 12 Nov 2013 12:31:53 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:Yee54XyCDuTv8GU3MG55gU+R+CY= Xref: number.nntp.dca.giganews.com comp.lang.ada:183827 Date: 2013-11-12T13:31:53+01:00 List-Id: Riccardo wrote: > type Euro is delta 0.01 digits 20; > -- Would be 20 enough? :-) Depends on your budget and your cash-flow. For mine it is plenty. > Are they currently used? Yes. > Where? In 182 out of 119_391 Ada source files (including duplicates) on my laptop. Reduced to unique type declarations, there is: type Decim is delta 0.1 digits 5; type Duration is delta 0.001 digits 9 range -24.0 * 3600.0 .. 48.0 * 3600.0; type Duration is delta 1.0 digits 9 range -24.0 * 3600.0 .. 48.0 * 3600.0; type Kroner is delta 0.01 digits 10; type Megabucks is delta 0.01 digits 15; type My_Float is delta 0.01 digits 10; type Percent is delta 0.01 digits 5 range 0.0 .. 100.0; type Push_Data_Type is delta 0.01 digits 7; type Real_Val_To_Print is delta 0.01 digits 8; > Since most of the examples are about money (mine and RM's) included, I > guess that they were thought for financial applications, but I am > unsure if nowadays financial software uses this type of types or just > floating point. This indicates that they are used for a few more cases than just money (2 of 9 are money types), but it appears that they aren't all that common. Greetings, Jacob -- "It's not a question of whose habitat it is, it's a question of how fast you hit it."