-
Notifications
You must be signed in to change notification settings - Fork 699
Closed
Labels
Description
I opened a PR on stacks-network/docs
to update the documentation (here: stacks-network/docs#1710), I was asked to open an issue here because it was auto-generated. That documentation for the pow
function appears to come from:
stacks-core/clarity/src/vm/docs/mod.rs
Lines 493 to 508 in 2caa9bf
const POW_API: SimpleFunctionAPI = SimpleFunctionAPI { | |
name: None, | |
snippet: "pow ${1:expr-1} ${2:expr-2}", | |
signature: "(pow i1 i2)", | |
description: "Returns the result of raising `i1` to the power of `i2`. In the event of an _overflow_, throws a runtime error. | |
Note: Corner cases are handled with the following rules: | |
* if both `i1` and `i2` are `0`, return `1` | |
* if `i1` is `1`, return `1` | |
* if `i1` is `0`, return `0` | |
* if `i2` is `1`, return `i1` | |
* if `i2` is negative or greater than `u32::MAX`, throw a runtime error", | |
example: "(pow 2 3) ;; Returns 8 | |
(pow 2 2) ;; Returns 4 | |
(pow 7 1) ;; Returns 7 | |
" | |
}; |
And I want to add;
- if
i2
is0
, return1
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status: ✅ Done