I'm trying to implement a simple hashcode formula, which results in this weird numbers: 4.788467514771005e+96
http://www.coderanch.com/t/395027/java/java/Jason-Bloch-hashCode-formula
Is it possible to convert it to normal integer?
Wouldn't round(x), floor(x), ceil(x) or int(x) do the trick?
Nope, tried that already. I want to use this hashcodes in a multiplayer game to check if grid state is in sync. The problem is when this number gets transmitted to another client it changes slightly, may be it is getting converted to a string.
Develop games in your browser. Powerful, performant & highly capable.
You can't do this in C2 as is. C2 uses floats internally, but a hash calculation must use integers. There is a hash plugin. See if that is sufficient. Otherwise you need this written in your own plugin.
You can either store it as a string, or attempt to convert it to an integer, but it looks like you'll lose some precision when you do that.
Thanks guys, I will try this CB Hash plugin.