comp.lang.ada
 help / color / mirror / Atom feed
From: "DuckE" <nospam_steved94@home.com>
Subject: Re: Decimal number of interger?
Date: Thu, 25 Oct 2001 01:38:40 GMT
Date: 2001-10-25T01:38:40+00:00	[thread overview]
Message-ID: <A2KB7.46995$Zb.23392590@news1.sttln1.wa.home.com> (raw)
In-Reply-To: 3BD70DE5.C2D2B6FD@ida.his.se

I would use something like:

  IF Abs( log2(width-1) - Float'Truncation( log2(width - 1) ) ) <
someMinDelta THEN
    ...

where "someMinDelta" gives an indication of how close is close enough.

SteveD

<a98mican@ida.his.se> wrote in message news:3BD70DE5.C2D2B6FD@ida.his.se...
> Hi!
> How do I determine weather the result from a function has a decimal part
> or not?
> 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"
>
>
> Thanks in advance!
> /Michael Andersson
>





  parent reply	other threads:[~2001-10-25  1:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-24 17:46 Decimal number of interger? a98mican
2001-10-24 19:54 ` tmoran
2001-10-24 23:35   ` Jeffrey Carter
2001-10-25  1:38 ` DuckE [this message]
2001-10-29 15:36 ` Tucker Taft
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox