Closed sashaduke closed 1 year ago
To be more precise WebAssembly supports floats just fine by itself, but Sasha has an application that only supports a subset of WASM that doesn't include floating point operations.
Also addressed in https://github.com/antouhou/rs-merkle/pull/16
I've added a comment to #16. Although this does remove the use of the float, this makes this incompatible with the no-std
. I'll try to come up with a way to do this without using floats and std. Being able to use this in the CosmWasm definitely an important feature. Thank you for the report!
Thanks for having a look.
You can always use a loop to count how many right shifts you need until the number turns to 0?
There was another PR with the same aim as mine that did something like this.
no_std
compatibility can be maintained by using core::mem::sizeof
instead of std::mem::sizeof
Hi @matthiasgoergens @sashaduke! I've merged your PRs and added one additional check for no-std targets. The changes are included in v1.3.0. Thank you! Please close this issue if that works for you, or I'll close it myself in some time :)
Thank you!
Awesome, thanks!
The use of a Float32 type in
src/utils/indices.rs
results in the crate not compiling on CosmWasm's WASM VM. A fix has been proposed on this pull request.