-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathrepl.txt
More file actions
36 lines (28 loc) · 829 Bytes
/
repl.txt
File metadata and controls
36 lines (28 loc) · 829 Bytes
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
{{alias}}( x )
Returns a JSON representation of a number.
Parameters
----------
x: number
Input value to serialize.
Returns
-------
out: Object
JSON representation if x is NaN or Infinity.
out.type: string
Value type. The assigned value is always "float32".
out.value: string
Value type. The assigned value can be "NaN", "+Infinity", "-Infinity".
out: number
In all other cases, the input value is returned.
Examples
--------
> var json = {{alias}}( NaN )
{ 'type': 'float32', 'value': 'NaN' }
> json = {{alias}}( Infinity )
{ 'type': 'float32', 'value': '+Infinity' }
> json = {{alias}}( -Infinity )
{ 'type': 'float32', 'value': '-Infinity' }
> json = {{alias}}( 5.0 )
5.0
See Also
--------