Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update functions.md #1710

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

0xpessimist
Copy link

Description

Added the case if exponent is 0, the result is definitely 1

added the case if exponent is 0, the result is definitely 1
@0xpessimist 0xpessimist requested a review from a team as a code owner February 28, 2025 15:09
@CLAassistant
Copy link

CLAassistant commented Feb 28, 2025

CLA assistant check
All committers have signed the CLA.

@wileyj
Copy link
Contributor

wileyj commented Feb 28, 2025

hmm - this file is the result of autogenerated docs. i can't say if your change is correct or not, but it's definitely not auto-generated:

cargo build --bin stacks-inspect
./target/debug/stacks-inspect docgen | jq . > ./clarity-reference.json

then, in ./clarity-reference.json:

    {
      "name": "pow",
      "snippet": "pow ${1:expr-1} ${2:expr-2}",
      "input_type": "int, int | uint, uint | string-ascii, string-ascii | string-utf8, string-utf8 | buff, buff",
      "output_type": "int | uint",
      "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.\nNote: Corner cases are handled with the following rules:\n  * if both `i1` and `i2` are `0`, return `1`\n  * if `i1` is `1`, return `1`\n  * if `i1` is `0`, return `0`\n  * if `i2` is `1`, return `i1`\n  * if `i2` is negative or greater than `u32::MAX`, throw a runtime error",
      "example": "(pow 2 3) ;; Returns 8\n(pow 2 2) ;; Returns 4\n(pow 7 1) ;; Returns 7\n",
      "min_version": "Clarity1",
      "max_version": null
    },

if it's missing and should be part of the definitiion - it will likely need to be addressed in https://github.com/stacks-network/stacks-core/

i'm going to block this PR for now, can you open a an issue in stacks-core and we'll see what that response is there?

Copy link
Contributor

@wileyj wileyj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please open an issue in stacks-core to determine if this is a problem with the autogenerated docs

@0xpessimist
Copy link
Author

Opened it, thx: stacks-network/stacks-core#5879

@wileyj
Copy link
Contributor

wileyj commented Mar 6, 2025

let's leave this open for now, and adjust pending the outcome of that issue/pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants