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.6 required=5.0 tests=BAYES_20,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,ddad8370bbebc0ef,start X-Google-Attributes: gid103376,public From: Hugh 'Huge' O'Donnell Subject: Re: Intel-OA: Using 'floor on float data type Date: 1999/02/02 Message-ID: <36B7B9A4.446A20BF@geocities.com>#1/1 X-Deja-AN: 440025035 Content-Transfer-Encoding: 8bit References: <9902021551.AA12360@ce101.ce.memphis.edu> To: "Orville E. Wheeler" X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: usenet@news.erinet.com X-Trace: news.erinet.com 918010471 24643 207.90.117.163 (3 Feb 1999 02:54:31 GMT) Organization: GeoCities Mime-Version: 1.0 NNTP-Posting-Date: 3 Feb 1999 02:54:31 GMT Newsgroups: comp.lang.ada Date: 1999-02-03T02:54:31+00:00 List-Id: Hello, This is how I fixed the problem with 'floor: type Index_Float is digits 10; Temp := Index_Float(Hypo.Score.Purity) * Index_Float(Num_Bins); Purity_Index := Integer(Index_Float'Floor(Temp) + 1.0); It appears that 'floor is an attribute of the type (Index_Float) that takes the variable in question as a parameter. The result must be type casted if an integer result is desired. If you look in Ada 95 LRM Section A.5.3: The following primitive function attributes are defined for any subtype S of a floating point type T. .... S�Floor denotes a function with the following specification: function S'Floor (X : T) return T An actual example of how to use this is found in Cohen's Ada as a Second Language on approximately pg 125. Thanks for your help, Hugh O'Donnell "Orville E. Wheeler" wrote: > > >Purity_Index := Index_Float(Temp)'Floor + 1; > > Try > > Purity_Index := Index_Float(Temp)'Floor + 1.0;