Lazarus

Programming => General => Topic started by: julkas on June 07, 2020, 08:16:27 pm

Title: [CLOSED] SizeOf Extended
Post by: julkas on June 07, 2020, 08:16:27 pm
Why on Win10 64b,  FPC 3.0.4 SizeOf(extended) is 8?
Title: Re: SizeOf Extended
Post by: Josh on June 07, 2020, 08:36:24 pm
HI

Probably same reason as Delphi

http://docwiki.embarcadero.com/Libraries/Rio/en/System.Extended

Title: Re: SizeOf Extended
Post by: julkas on June 07, 2020, 08:56:50 pm
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
Title: Re: SizeOf Extended
Post by: lucamar on June 07, 2020, 09:14:58 pm
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
Title: Re: SizeOf Extended
Post by: PascalDragon on June 07, 2020, 09:15:05 pm
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.
Title: Re: SizeOf Extended
Post by: julkas on June 07, 2020, 09:24:58 pm
We must update documentation.
Title: Re: [CLOSED] SizeOf Extended
Post by: Handoko on August 04, 2020, 03:58:17 pm
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
Title: Re: [CLOSED] SizeOf Extended
Post by: lucamar on August 04, 2020, 04:34:31 pm
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.
Title: Re: [CLOSED] SizeOf Extended
Post by: Kays on August 04, 2020, 05:13:44 pm
[…] 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).
Title: Re: [CLOSED] SizeOf Extended
Post by: Thaddy on August 04, 2020, 05:15:43 pm
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-) )
Title: Re: SizeOf Extended
Post by: PascalDragon on August 05, 2020, 09:44:09 am
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. :)
TinyPortal © 2005-2018