math test!

From: Betsy (betsy.a.tainer_at_lesschwab.com)
Date: 01/23/04


Date: Fri, 23 Jan 2004 14:17:17 -0800

Am I missing something or is there a shortage of really weird and useful
math functions in the MATH unit?

I can probably come up with something if I play around with it long
enough... but I need a function that will round to the nearest specified
integer/multiple (might have said that wrong)... as in...

fx(13,4) -> 12 , where 12 is the nearest integer that is a multiple of 4
(get it?)
fx(15,4) -> 16
fx(2,4) -> 0
fx(3,4) -> 4
fx(50,4) ->52

similar to MROUND(B4,4) *where b4 is the number needing some adjustment.
as a function in Excel

as it stands I think I'll have to loop, adding or subtracting 1 until x mod
y = 0 where y is 4 and x is the number needing adjustment. Do you think
that that is the best I can do?

any assistance greatly appreciated.
b



Relevant Pages

  • Re: math test!
    ... > Am I missing something or is there a shortage of really weird and useful ... > math functions in the MATH unit? ...
    (borland.public.delphi.language.objectpascal)
  • Re: math test!
    ... > Am I missing something or is there a shortage of really weird and useful ... > math functions in the MATH unit? ... Should it round up or down if the difference is exactly half the multiple? ...
    (borland.public.delphi.language.objectpascal)