Hot answers tagged

11 votes
Accepted

What's the best way to compute square root in Substrate?

If you are just after the integer sqrt (which, depending on your use-case, may be enough), you could follow the approach that the democracy pallet does. In this case it uses integer_sqrt::...
Jaco's user avatar
  • 5,805
8 votes

What's the best way to compute square root in Substrate?

TLDR: sp-arithmetic for relatively simple use cases as highlighted in this answer, and substrate-fixed for more advance stuff. To perform non-deterministic arithmetic like division and square roots, ...
islami00's user avatar
  • 561
2 votes

How do I best calculate angle differences when crossing the 360 axis? (Python)

I think you are in the wrong Stack Exchange :) But I don't think it's possible for anyone to answer without knowing the data source, e.g. is it a lateral inertial sensor that senses side-to-side ...
joepetrowski's user avatar
  • 2,895

Only top scored, non community-wiki answers of a minimum length are eligible