Unsigned integer subtraction
Solution
When a subtraction result would be negative, the answer should be zero. The following query creates a UDF that performs the calculation:
The following query calls the UDF with parameters that return a positive result:
LongV(78)
78
78
78
78
78
The following query calls the UDF with parameters that return what would have been a negative result:
LongV(0)
0
0
0
0
0
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!