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
Was this article helpful?
We're sorry to hear that.
Tell us how we can improve!
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!