Re: rounding a number



To round like APL rounds, use Fuzzy tolerances for the Floor function
(called TFLOOR) and then compute Round = tfloor(x+0.5_Precision)
(see TFLOOR and ROUND a la APL but coded in Fortran at:

http://ftp.cac.psu.edu/pub/ger/fortran/hdk/eps.f90

Skip Knoble

On 27 Nov 2006 10:58:29 -0800, "arman" <previah@xxxxxxxxx> wrote:

-|Hi,
-|How do you round some arbitrary number to the 10 multiplier? I need to
-|make a graph. The y-axis is dependent on the result of the computation.
-|If the maximum value of the y-axis, say for example 278, then I want
-|the y-axis to have a maximum of 300, or if it 2435 then I want the
-|maximum of 2500. So, basically it has to convert an arbitrary number
-|into some integer number that can be divided by 10.
-|
-|thanks in advance,
-|-arman-

.



Relevant Pages

  • RE: rounding a number
    ... (see TFLOOR and ROUND a la APL but coded in Fortran at: ... Skip Knoble ... The y-axis is dependent on the result of the computation. ...
    (comp.lang.fortran)
  • RE: rounding a number
    ... (see TFLOOR and ROUND a la APL but coded in Fortran at: ... Skip Knoble ... The y-axis is dependent on the result of the computation. ...
    (comp.lang.fortran)
  • Re: rounding a number
    ... How do you round some arbitrary number to the 10 multiplier? ... The y-axis is dependent on the result of the computation. ... easier way Is to just do an integer divide. ... multiply brings you back to a multiple of 10 that is smaller than you ...
    (comp.lang.fortran)