It divides integers and potentially emits a floating point number.
Input | Output |
---|---|
{"a":0,"b":1}
|
0
|
{"a":1,"b":1}
|
1
|
{"a":2,"b":5}
|
0.4
|
It divides floats.
Input | Output |
---|---|
{"a":0.5,"b":0.5}
|
1
|
{"a":4.5,"b":0.5}
|
9
|
{"a":1.5,"b":2}
|
0.75
|
It divides integers with negative signs correctly.
Input | Output |
---|---|
{"a":-2,"b":5}
|
-0.4
|
{"a":2,"b":-5}
|
-0.4
|
{"a":-2,"b":-5}
|
0.4
|
It returns null of the dividend is 0.
Input | Output |
---|---|
{"a":0.5,"b":0}
|
null
|
{"a":0,"b":0}
|
null
|