![]() |
Re: Needing A header file
Quote:
An example variable declaration could be: integer max_v; // 2FX12 (0x1000 = 1 foot/sec) In the above example, the resolution of the variable for maximum velocity is 0.003 inches per second and the variable ranges from + +7.99975 to -7.99975 feet per second. Choose your number system with care and beware of overflowing variables in your calculations. Also realize that 0x8000 (negative zero) is not a number! I assure you that the 2004 Bobcat has no floating-point variables and, sensor accuracy notwithstanding, the mathematical accuracy of our position is less than a tenth of an inch. Best of luck, |
Re: Needing A header file
Can you give me a tutorial or example where I can learn more about this? ALl i've learned so far for decimal points is floating point data types. APpreciate any info.
|
Re: Needing A header file
Quote:
Unfortunately, everything I have is in books. You might try to google it. |
Floating Point Tutorial
Quote:
Most important thing about floating point: DO NOT use unless absolutely neccessary. Any computation with floating-point data (like floats or doubles) is much slower than the same operation with integers (like chars, ints, and longs).Floating-point data is different than other data because the number that the data itself represents is not directly stored. Instead, a mantissa, sign, and exponent are stored. This is sort of like scientific notation where you know the exponent which for the base 10 and the multiplier. In floating-point, you store every number as: [sign] [mantissa] x 2 ^ ([exponent]) The 2 is not stored because it is the same for every number. Sign is 0 if the number is positive, and 1 if the number is negative (only one bit stored). Exponents must account for both negative and positive exponents, hence the exponent has a bias. This means that a positive number is added to all exponents in order to make every possible exponent positive. Mantissas, get information here: http://research.microsoft.com/~holla...ieeefloat.html Hope this helps! |
Re: Needing A header file
Quote:
It should get you started... |
| All times are GMT -5. The time now is 09:28. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi