[gameprogrammer] Re: Fixed point math
- From: "Gautam Narain" <gautam_n_@xxxxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Sun, 07 Nov 2004 11:45:47 +0530
Hi,
Yes I can get by with 14.16 format. As long as the higher bit is 16 I should
be able to get along with it. How exactly would I implement 1.15 ? Could you
give me an example of converting a number to 1.15. However I am not sure if
I can get by with 1.15.
Thanks.
Gautam
>On Wed, 2004-10-20 at 12:08, Gautam Narain wrote:
>Hi,
>
>>Kevin, you are partly right and partly wrong. I am targetting Opengl ES
>>which needs fixed point support. However I am targetting the Khronos
>>contest and not the gamedev one and a linux application(game). Anyway I do
>>this for a hobby so I figured well - I will aim for the contest.
>>
>>I changed the following in the code
>>long long e = FIXMUL(c, d);
>My guess is that it is doing a 32 bit multiply and then converting the
>result to 64 bits. It would do that because c and d are 32 bit numbers.
>>
>>This gives me zero as well. However when I do it with floating point
>>numbers, I get the values after the decimal(fraction) correctly but the
>>main number is zero. Any ideas why it could be truncating ? Lastly I don't
>>think OpenGL ES has 64 bit support(so long long may not be supported). So
>>I will probably be stuck with int's. But I need to use 15.16 fixed point
>>variables. Should I do everything in 7.8 bit and the convert to 15.16 bit
>>? Would this slow things down or make it equal to if I did it with just
>>floats ?
>Why must you use 15.16 numbers? BTW, if you multiply a 7.8 number by
>another 7.8 number you get a 14.16 number. Can you get by with
>converting everything to a fraction and using something like 1.15
>numbers?
> Bob Pendleton
>
>>Thanks
>>
>>Gautam
_________________________________________________________________
Millions of active and validated profiles.
http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 Find your match on
BharatMatrimony.com
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- Follow-Ups:
- [gameprogrammer] Re: Fixed point math
- From: Bob Pendleton
Other related posts:
- » [gameprogrammer] Fixed point math
- » [gameprogrammer] Re: Fixed point math
- » [gameprogrammer] Re: Fixed point math
- » [gameprogrammer] Re: Fixed point math
- » [gameprogrammer] Re: Fixed point math
- [gameprogrammer] Re: Fixed point math
- From: Bob Pendleton