mround

fun mround(x: DoubleArray, granularity: DoubleArray?): DoubleArray

contributed by Andrew Gibson round the 1D array x to a multiple of granularity (double[]) note that 0 or null granularity values are interpreted as "no rounding"

Return

  • 1 1D array of elements i s.t. xi is rounded to granularityi

Parameters

x
  • the input

granularity
  • the granularity to which to round x


fun mround(x: Double, granularity: Double): Double

contributed by Andrew Gibson round a scalar double to a multiple of granularity note that 0 a granularity value is interpreted as "no rounding"

Return

x rounded to granularity

Parameters

x
  • input

granularity

a scalar Double


fun mround(x: DoubleArray, granularity: Double): DoubleArray

contributed by Andrew Gibson round a 1D array x to a multiple of a scalar granularity value note that 0 or null granularity values are interpreted as "no rounding"

Return

  • 1D array the same size as x

Parameters

x
  • input[]

granularity
  • Double