forked from stdlib-js/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepl.txt
More file actions
55 lines (47 loc) · 1.15 KB
/
repl.txt
File metadata and controls
55 lines (47 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{{alias}}( bstr )
Creates a half-precision floating-point number from an IEEE 754 literal
bit representation.
Parameters
----------
bstr: string
Literal bit representation.
Returns
-------
out: float
Half-precision floating-point number.
Examples
--------
> var bstr = '0100010000000000';
> var val = {{alias}}( bstr )
4.0
> bstr = '0100001001001000';
> val = {{alias}}( bstr )
~3.140625
> bstr = '1110001111010000';
> val = {{alias}}( bstr )
-1000.0
// The function handles subnormals:
> bstr = '0000000000000001';
> val = {{alias}}( bstr )
~5.96e-8
> bstr = '1000000000000001';
> val = {{alias}}( bstr )
~-5.96e-8
// The function handles special values:
> bstr = '0000000000000000';
> val = {{alias}}( bstr )
0.0
> bstr = '1000000000000000';
> val = {{alias}}( bstr )
-0.0
> bstr = '0111110000000001';
> val = {{alias}}( bstr )
NaN
> bstr = '0111110000000000';
> val = {{alias}}( bstr )
Infinity
> bstr = '1111110000000000';
> val = {{alias}}( bstr )
-Infinity
See Also
--------