"Vitaly Budovski" vbudovski@gmail.com wrote:
+struct tinn +{
- /* Pointer to an element in the list. */
- const RGBQUAD *data;
- /* Distance from the reference element. */
- float distance;
+};
Vitaly, why do you keep resending the same patch which uses float values internally? Again, float neither doesn't allow you to process larger values, nor is acceptable for speed or adds more flexibility.
Dmitry Timoshkov wrote:
"Vitaly Budovski" vbudovski@gmail.com wrote:
+struct tinn +{
- /* Pointer to an element in the list. */
- const RGBQUAD *data;
- /* Distance from the reference element. */
- float distance;
+};
Vitaly, why do you keep resending the same patch which uses float values internally? Again, float neither doesn't allow you to process larger values, nor is acceptable for speed or adds more flexibility.
I actually discussed this with Alexandre on irc and he said that it was okay to leave it like that. Please show me how an unsigned int can represent values greater than 2^32. This is why a float is used.
"Vitaly Budovski" vbudovski@gmail.com wrote:
Please show me how an unsigned int can represent values greater than 2^32. This is why a float is used.
Of course int can't, but neither float can. Perhaps you confuse it with double?
Dmitry Timoshkov wrote:
"Vitaly Budovski" vbudovski@gmail.com wrote:
Please show me how an unsigned int can represent values greater than 2^32. This is why a float is used.
Of course int can't, but neither float can. Perhaps you confuse it with double?
I'm pretty sure I'm not confusing it with double. http://steve.hollasch.net/cgindex/coding/ieeefloat.html http://en.wikipedia.org/wiki/IEEE_754#Single-precision_32_bit
An int value can be more precise then a float can, however a float can hold bigger numbers. It's the difference between having a 24 bit fraction with 8 bits of exponent and 1 of sign vs 31/32 bits of fraction data without exponent. Plus, integer operations are faster then floating point operations, even if just margionably.
On 5/9/07, Vitaly Budovski vbudovski@gmail.com wrote:
Dmitry Timoshkov wrote:
"Vitaly Budovski" vbudovski@gmail.com wrote:
Please show me how an unsigned int can represent values greater than 2^32. This is why a float is used.
Of course int can't, but neither float can. Perhaps you confuse it with double?
I'm pretty sure I'm not confusing it with double. http://steve.hollasch.net/cgindex/coding/ieeefloat.html http://en.wikipedia.org/wiki/IEEE_754#Single-precision_32_bit
Dmitry Timoshkov [mailto:dmitry@codeweavers.com] wrote:
"Vitaly Budovski" vbudovski@gmail.com wrote:
Please show me how an unsigned int can represent values greater than 2^32. This is why a float is used.
Of course int can't, but neither float can. Perhaps you confuse it with
double?
I think float can represent integers larger than 2^32 but it will be not anymore fully accurate. In fact it will start getting inaccurate in representing every possible integer at around 2^22. But that does not mean that it can't represent 2^40 approximately. The maximum decimal range of a float is around +-4 * 10 ^ 38 compared to 4 * 10 ^ 9 for an unsigned 32 bit integer.
So if full integer accuracy is not a concern, which I think isn't in this case, floats definitely have a range advantage over 32 bit integers. Even 64 bit integers can't cover that range although they might have a large enough range for this problem.
Rolf Kalbermatter