[futurebasic] Re:INTs vs ROUND

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2001 : Group Archive : Group : All Groups

From: pochas <pochas@...>
Date: Tue, 10 Jul 2001 12:42:51 -0400
Charles P:

The problem is that
>      >the present INT function rounds the result up if the fraction is >= 0.5.
>      > This is almost never desired.  I'll bet that almost 100 percent of the
>      >time the INT function is used it introduces unintentional errors, just
>      >like the rounding examples in this thread, and for that reason alone it
>      >should be eliminated.  If you want to round, you need two parameters:
>      >ROUND(number, places).
>      >Trying to include rounding in a single-parameter function is not a
>      >feature, it's a bug.
>      >
>      >Regards,
>      >
>      >Charles P.
> 
> 

Robert Covington:

>      Charles, is your beef with INT that
> 
>      INT(1.49) returns   1  in FB 3
> 
>      but
> 
>      INT(1.5 ) returns  2  in FB 3
> 
>      ?
> 
>      I can see your point, as I had a bit of adjustment time taking to the FB 3
>      way of INT over the FB II version, but prefer it now.  I would lose data
>      during convolutions if it was to return a 1 for  INT(1.9)
> 
>      You can still have your INT(1.5) = 1 by using FIX(1.5)
> 
>      ?
> 
>      Robert Covington


I converted all my INT's to FIX.

Charles P.