Skip to main content
100%

Factorial

✓ Published0🌍 Public
CCliffordAnderson
Last edited Jun 14, 2022
Created on Jun 14, 2022

This example demonstrates the computation of the factorial of 10 using XQuery 3.1. It shows two distinct implementation approaches: a recursive function `local:fac` and a higher-order function `local:hFac` that uses `fn:fold-right` with an anonymous function. The program executes `local:hFac(10)`, which iteratively multiplies values from 1 to 10. The data is not visualized graphically; instead, the output is the numeric result of the calculation. The code relies on XQuery’s built-in type annotations (`xs:int`) and function library, with no external visualization libraries involved.

AI-generated description

Similar vizzes