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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b5627b980414da76 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-15 16:10:42 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!scsing.switch.ch!news.dfn.de!RRZ.Uni-Koeln.DE!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!alpha1.csv.ica.uni-stuttgart.de!ucaa2385 From: ucaa2385@alpha1.csv.ica.uni-stuttgart.de (Peter Hermann) Newsgroups: comp.lang.ada Subject: Re: Higher precision and generics Date: 15 Mar 1995 16:35:46 GMT Organization: Comp.Center (RUS), U of Stuttgart, FRG Message-ID: <3k7512$kln@info4.rus.uni-stuttgart.de> References: <3jsnbf$ido@nef.ens.fr> NNTP-Posting-Host: alpha1.csv.ica.uni-stuttgart.de X-Newsreader: TIN [version 1.2 PL2] Date: 1995-03-15T16:35:46+00:00 List-Id: Mats Weber (Mats.Weber@matrix.ch) wrote: : In article <3jsnbf$ido@nef.ens.fr>, sands@clipper.ens.fr (Duncan Sands) wrote: : > I am writing a package of matrix routines (in Ada!) in which some : intermediate results : > should be calculated in higher precision than normal. The type for : normal precision is : > called Real and is a generic parameter of my package: : > generic : > type Real is digits <>; : > package Matrix_Stuff is [snip] : generic : type Real is digits <>; : type Double_Real is digits <>; : package Matrix_Stuff is : ... : end; I do not favor Mats' solution. We had the same situation about 20 years ago in a major finite element code: people believed it to be useful to have Fortran code with mixed precision. This turned out to become far too complex! I would recommend to use the above (first) generic package in a straightforward manner, i.e. once instantiated for a single precision type, next time for a double precision type (in Fortran-speak). That's what generic units are for. -- Peter Hermann Tel:+49-711-685-3611 Fax:3758 ph@csv.ica.uni-stuttgart.de Pfaffenwaldring 27, 70569 Stuttgart Uni Computeranwendungen Team Ada: "C'mon people let the world begin" (Paul McCartney)