in reply to Re: Rounding values upwards on an arbitrary basis
in thread Rounding values upwards on an arbitrary basis

Well, the bizarre thing about this problem is that the function ibanix described is not idempotent. E.g. f(124)=125 but f(f(124))=150. So it shouldn't really be called a "rounding" function. I don't know if that's really what he wanted, but it is what he asked for.

Abigail's function is more reasonable, but not what ibanix asked for.

  • Comment on Re: Re: Rounding values upwards on an arbitrary basis

Replies are listed 'Best First'.
Re: Rounding values upwards on an arbitrary basis
by Abigail-II (Bishop) on Jul 02, 2003 at 21:12 UTC
    Yeah, well you could solve that by adding something like:
    $new += $frac if int ($_ / $frac) == ceil ($_ / $frac);

    Abigail