0 Members and 1 Guest are viewing this topic.
Nice never come across this beforeWorth mentioning though that although you get better compression than using bit shifts, this method is more cpu-intensive
Thinking about it, why do you have to use primes? Perhaps i'm missing something obviousThe mod and div will work regardless.
it's a perfect way to create multiple layered maps or even combining many maps in a single matrix even if they had different sizes as the result is such a case yould just be 0 without ever causing an error ^^Definitely gonna use it for my walrus game ^^ (actually working on that part right now)Thx @E37 for sharing this with us ^^
double _data = 901*901*5 + 901*6 + 7; // 5, 6, 7int _mod1 = (int) _data%901;int _mod2 = (int) ((_data-_mod1)/901)%(901);int _mod3 = (int) (_data-_mod1-901*_mod2)/(901*901);System.out.println(_mod1);System.out.println(_mod2);System.out.println(_mod3);
Page created in 0.091 seconds with 55 queries.