stacks-network / docs

Unleash Bitcoin's full potential with decentralized apps and smart contracts. The documentation covers key aspects of the Stacks network and technology and provides tutorials and other helpful content for developers.
https://docs.stacks.co
Creative Commons Zero v1.0 Universal
156 stars 235 forks source link

log2 description and examples #1549

Closed c0d3rk1d closed 1 year ago

c0d3rk1d commented 1 year ago

Description

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
stacks-docs ✅ Ready (Inspect) Visit Preview Sep 19, 2022 at 5:51AM (UTC)
c0d3rk1d commented 1 year ago

<1 if check from VM code at https://github.com/stacks-network/stacks-blockchain/blob/master/clarity/src/vm/functions/arithmetic.rs#L230

criadoperez commented 1 year ago

<1 if check from VM code at https://github.com/stacks-network/stacks-blockchain/blob/master/clarity/src/vm/functions/arithmetic.rs#L230

In my opinion the text log2 must be passed a positive integer in the code line you pointed out can be a bit ambiguous and should be changed.

Event though some don't consider 0 to be a positive integer, mathematically speaking it is. So it's unclear. In my opinion, this should be replaced with something like log2 must be passed a positive integer equal or larger than 1 or log2 must be passed a positive integer larger than 0.

I recommend you open a PR on that repository, pointing out this issue you detected. It will be interesting to see how the rest see it.