It returns the product of positive integers.
Input | Output |
---|---|
{"a":1,"b":0}
|
0
|
{"a":0,"b":4}
|
0
|
{"a":2,"b":5}
|
10
|
It copes with floating point numbers.
Input | Output |
---|---|
{"a":0.5,"b":0.5}
|
0.25
|
{"a":-1.3,"b":0.5}
|
-0.65
|
{"a":6.2,"b":0}
|
0
|
It evaluates the signs correctly.
Input | Output |
---|---|
{"a":-2,"b":5}
|
-10
|
{"a":2,"b":-5}
|
-10
|
{"a":-2,"b":-5}
|
10
|
It returns null if one or both factors are null.
Input | Output |
---|---|
{"a":null,"b":0.5}
|
null
|
{"a":null,"b":null}
|
null
|
{"a":null,"b":0}
|
null
|