flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
d0z 24 Oct 2005, 20:34
Hehe, if you read my previous post you can atleast see one error in it. I'm trying to represent a double word with 30bits.
![]() What I have learned from this is to never trust Microsoft's calculator as it cuts of ending zeros. The bits should look like this: 0|01111100|01100011101000011001000 If I have understood floating numbers this is how it works. Lets say we have bit 0 to the right and bit 31 to the left. Bit31 = 1 if negative otherwise 0 Bit23-30 = Exponent Bit0-22(23) = Mantissa Bit23 is a very special bit since it being assumed to be 1 when used together with mantissa even if it is 0 in my example above. It is only assumed to be 0 in special cases. The mantissa is represented like this when you calculate it: 1.01100011101000011001000 2^0+0^-1+2^-2...+0^-23 If you want to make it easy on yourself you put everything after the dot in a calculator converts it to decimal and divide it by 2^23 and then add 1. Conclusion: What I tried to represent as a dw was 0.173648 if you do the calculation from my bits above you get. 1*2^(124-127)*1.389183=0.1736478. So it seems my previous code was right and Fasm handles my Sin value as single precision. If you would like to know more about float go here http://stevehollasch.com/cgindex/coding/ieeefloat.html Hopefully this helps some confused float newbies as myself. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.