J
James Thurley
According to the docs, floats are 32 bit and doubles are 64 bit. So
using floats should be faster than using doubles on a 32 bit processor,
and my tests confirm this. However, most of the Math methods deal with
doubles and I'm having problems with casting them back to floats.
For example:
(double)0.1f = 0.10000000149011612
I don't need the accuracy of doubles, but the speed of floats would be
benificial, but it seems I'm either going to have to write my own math
functions or just use doubles. For the record my rather basic test,
which just performed lots of multiplications and divisions, took half
the time using floats as using doubles.
Has anyone else had this problem? And can someone give me an efficient
Floor algorithm so I can write my own floating point version?
James.
using floats should be faster than using doubles on a 32 bit processor,
and my tests confirm this. However, most of the Math methods deal with
doubles and I'm having problems with casting them back to floats.
For example:
(double)0.1f = 0.10000000149011612
I don't need the accuracy of doubles, but the speed of floats would be
benificial, but it seems I'm either going to have to write my own math
functions or just use doubles. For the record my rather basic test,
which just performed lots of multiplications and divisions, took half
the time using floats as using doubles.
Has anyone else had this problem? And can someone give me an efficient
Floor algorithm so I can write my own floating point version?
James.