time-to-botec

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

repl.txt (1117B)


      1 
      2 {{alias}}( x, y )
      3     Returns a double-precision floating-point number with the magnitude of `x`
      4     and the sign of `x*y`.
      5 
      6     The function only returns `-x` when `y` is a negative number.
      7 
      8     According to the IEEE 754 standard, a `NaN` has a biased exponent equal to
      9     `2047`, a significand greater than `0`, and a sign bit equal to either `1`
     10     or `0`. In which case, `NaN` may not correspond to just one but many binary
     11     representations. Accordingly, care should be taken to ensure that `y` is not
     12     `NaN`, else behavior may be indeterminate.
     13 
     14     Parameters
     15     ----------
     16     x: number
     17         Number from which to derive a magnitude.
     18 
     19     y: number
     20         Number from which to derive a sign.
     21 
     22     Returns
     23     -------
     24     z: number
     25         Double-precision floating-point number.
     26 
     27     Examples
     28     --------
     29     > var z = {{alias}}( -3.14, 10.0 )
     30     -3.14
     31     > z = {{alias}}( -3.14, -1.0 )
     32     3.14
     33     > z = {{alias}}( 1.0, -0.0 )
     34     -1.0
     35     > z = {{alias}}( -3.14, -0.0 )
     36     3.14
     37     > z = {{alias}}( -0.0, 1.0 )
     38     -0.0
     39     > z = {{alias}}( 0.0, -1.0 )
     40     -0.0
     41 
     42     See Also
     43     --------
     44