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,c81958079621fd4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-24 12:54:19 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc1.sfba.home.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Decimal number of interger? References: <3BD70DE5.C2D2B6FD@ida.his.se> X-Newsreader: Tom's custom newsreader Message-ID: Date: Wed, 24 Oct 2001 19:54:18 GMT NNTP-Posting-Host: 24.7.82.199 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.sfba.home.com 1003953258 24.7.82.199 (Wed, 24 Oct 2001 12:54:18 PDT) NNTP-Posting-Date: Wed, 24 Oct 2001 12:54:18 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:15151 Date: 2001-10-24T19:54:18+00:00 List-Id: >How do I determine weather the result from a function has a decimal part >or not? x : float := function_value(y); begin if float(integer(x)) = x then -- decimal part of x is zero >I want to use the log function to se weather the width of the terrain is >(2^x)+1. In order to do this I want to use the following: >log2(width-1) = "float without decimal part" test : interfaces.unsigned_32 := interfaces.unsigned_32(width-1); begin if (test and (test-1)) = 0 then -- test (ie, width-1) is a power of 2.