factorial
Find the product of all positive integers from 1 to a given non-negative integer. Accepts only non-negative integers and returns an error for invalid inputs.
Instructions
Calculate the factorial of a given number.
Args:
data (SingleNumberOperation): An object containing the input number a.
Returns:
Dict[str, Any]: A dictionary containing the operation result or an error message.
Raises:
ValueError: If the input is negative or not an integer.
Notes:
- Only works with non-negative integers.
- Logs the operation and result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||