time-to-botec

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

repl.txt (1678B)


      1 
      2 {{alias}}( bstr )
      3     Creates a double-precision floating-point number from a literal bit
      4     representation.
      5 
      6     Parameters
      7     ----------
      8     bstr: string
      9         Literal bit representation.
     10 
     11     Returns
     12     -------
     13     out: number
     14         Double-precision floating-point number.
     15 
     16     Examples
     17     --------
     18     > var bstr;
     19     > bstr = '0100000000010000000000000000000000000000000000000000000000000000';
     20     > var val = {{alias}}( bstr )
     21     4.0
     22     > bstr = '0100000000001001001000011111101101010100010001000010110100011000';
     23     > val = {{alias}}( bstr )
     24     3.141592653589793
     25     > bstr = '1111111111100001110011001111001110000101111010111100100010100000';
     26     > val = {{alias}}( bstr )
     27     -1.0e308
     28 
     29     // The function handles subnormals:
     30     > bstr = '1000000000000000000000000000000000000000000000000001100011010011';
     31     > val = {{alias}}( bstr )
     32     -3.14e-320
     33     > bstr = '0000000000000000000000000000000000000000000000000000000000000001';
     34     > val = {{alias}}( bstr )
     35     5.0e-324
     36 
     37     // The function handles special values:
     38     > bstr = '0000000000000000000000000000000000000000000000000000000000000000';
     39     > val = {{alias}}( bstr )
     40     0.0
     41     > bstr = '1000000000000000000000000000000000000000000000000000000000000000';
     42     > val = {{alias}}( bstr )
     43     -0.0
     44     > bstr = '0111111111111000000000000000000000000000000000000000000000000000';
     45     > val = {{alias}}( bstr )
     46     NaN
     47     > bstr = '0111111111110000000000000000000000000000000000000000000000000000';
     48     > val = {{alias}}( bstr )
     49     Infinity
     50     > bstr = '1111111111110000000000000000000000000000000000000000000000000000';
     51     > val = {{alias}}( bstr )
     52     -Infinity
     53 
     54     See Also
     55     --------
     56