time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (736B)


      1 
      2 {{alias}}( x, n )
      3     Rounds a numeric value to the nearest multiple of `10^n` toward negative
      4     infinity.
      5 
      6     When operating on floating-point numbers in bases other than `2`, rounding
      7     to specified digits can be inexact.
      8 
      9     Parameters
     10     ----------
     11     x: number
     12         Input value.
     13 
     14     n: integer
     15         Integer power of 10.
     16 
     17     Returns
     18     -------
     19     y: number
     20         Rounded value.
     21 
     22     Examples
     23     --------
     24     // Round to 4 decimal places:
     25     > var y = {{alias}}( 3.14159, -4 )
     26     3.1415
     27 
     28     // If `n = 0`, standard round toward negative infinity behavior:
     29     > y = {{alias}}( 3.14159, 0 )
     30     3.0
     31 
     32     // Round to nearest thousand:
     33     > y = {{alias}}( 12368.0, 3 )
     34     12000.0
     35 
     36 
     37     See Also
     38     --------
     39