In Delphi, and why don't they have a direct mapping of threadlike floating point types?

I tested this in Delphi 6.7 and XE2, all this shows this error.
I would like to compare two floating point numbers in a stream, for example:

threadvar a,b : Double; procedure test; begin if a > b then ; end; 

but an internal error occurred while compiling DCC. Therefore, I changed it as follows:

 threadvar a,b : Double; procedure test; begin if a - b > 0 then ; end; 

the error has disappeared, why?

+4
source share
1 answer

This is clearly a compiler error. I reported an error in Quality Central, QC # 101656 . The error only affects the 32-bit compiler, and not that it will be a great comfort to anyone!

You can get around this by putting the variables in the record as follows:

 threadvar r: record a,b: Double; end; procedure test; begin if ra > rb then ; end; 
+3
source

Source: https://habr.com/ru/post/1385273/


All Articles