I'm developing an Android game. At the moment I'm writing code that should calculate the best route between two objects, using the A* algorithm. Inside the algorithm i'm using doubles to calculate everything.
When running time consuming algorithms on my computer the time difference between calculating with Integers and Doubles is almost zero (maybe a few nanoseconds).
Question one:
Can this behavior also seen on Android phones? I know my computer has multiple ALU's one for integers on for floating points etc. But how about phones? Android phones can be very different when it comes down to hardware. I only have two test phones, but today there are hundreds of phones available on the market, which means that running tests on two of my phones would not give me reliable data, at least that's what I think.
Question two:
For my game it doesn't matter allot if I switch to Integers, the calculated route maybe less perfect but that doesn't bother me. So is it worth switching to integers? Or would switching to integers break the algorithm? Does anyone have experience with this?