Lazarus
Programming => General => Topic started by: julkas on June 07, 2020, 08:16:27 pm
-
Why on Win10 64b, FPC 3.0.4 SizeOf(extended) is 8?
-
HI
Probably same reason as Delphi
http://docwiki.embarcadero.com/Libraries/Rio/en/System.Extended
-
HI
Probably same reason as Delphi
http://docwiki.embarcadero.com/Libraries/Rio/en/System.Extended
Ok. But it must be 10 -
https://www.freepascal.org/docs-html/ref/refsu5.html
https://wiki.freepascal.org/Variables_and_Data_Types
-
Ok. But it must be 10 -
No, in Windows 64 bits Extended is the same as Double. Something to do with Microsoft having deprecated "extended" :o
-
Why on Win10 64b, FPC 3.0.4 SizeOf(extended) is 8?
On Win64 (and any non-x86) target the Extended type is an alias to Double, because the 80-bit floating point type is not available. Microsoft has deemed the x87 FPU as deprecated with Windows 64-bit, thus applications shouldn't make use of it and FPC adheres to that.
-
We must update documentation.
-
Someone who is good in English, please update these pages:
https://wiki.freepascal.org/Variables_and_Data_Types
https://wiki.freepascal.org/IEEE_754_formats
-
Someone who is good in English, please update these pages:
https://wiki.freepascal.org/Variables_and_Data_Types
https://wiki.freepascal.org/IEEE_754_formats
Done for the former; the later already had a note about platforms which don't support Extended.
-
[…] Done for the former; the later already had a note about platforms which don't support Extended.
Well, I just added it (https://wiki.freepascal.org/Special:Diff/138837). The important thing is, though, that the programmer’s guide correctly documents the FP types (https://freepascal.org/docs-html/current/prog/progsu159.html).
-
Couple of remarks:
1. FPC can actually support 10 bits extended on win64, but it is non-standard (in the sense of non-abi compliant) and requires a recompile of the compiler and rtl. Not recommended unless you really need it. Florian explained somewhere how to do that. (can't find it soon enough, but the info is there)
2. The issue at hand is the same for (48 bit) real, which is aliased to double, but has a support unit to be able to read/write and to some extend calculate with 48 bit real values. (unit real48, which is in reality the real real and not a double 8-) )
-
We must update documentation.
Well, it is (partially) mentioned in the Programmer's Guide (https://freepascal.org/docs-html/current/prog/progsu159.html#x203-2110008.2.5) (as Kays already wrote) as any non-x86 has Extended = Double as well, but the oddity that is Win64 is not mentioned and it should also be mentioned in the Language Reference Guide (https://freepascal.org/docs-html/current/ref/refsu5.html#x27-300003.1.2). Thus I've filed a bug report for this. :)