FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date. For more details, review the migration guide. Contact support@fauna.com with any questions. |
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:
78
78
78
LongV(78)
78
The following query calls the UDF with parameters that return what would have been a negative result:
0
0
0
LongV(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!