Using Extended in Delphi XE2 64 bit
Unfortunately, Delphi's 64-bit compiler (dcc64) and RTL do not support
extended floating point values on Win64, but silently alias
Extended = Double on Win64.
There are situations, however, where this is clearly undesirable, e.g. if
the additional precision gained from
Extended is required.
uTExtendedX87 unit provides a
replacement FPU-backed 80-bit Extended floating point type
TExtendedX87) for Win64.
Quoted from the unit presentation:
The aim of this unit is to provide basic 80-bit extended capabilities for Delphi x64 by providing:
- A dedicated FPU-backed TExtendedX87 type that behaves as an 80-bit extended value both on 32-bit and 64-bit platforms
- Re-implementing basic routines from the System unit for this type on 32-bit and 64-bit
Users should be able to either re-declare their variables explictly as
TExtendedX87or redeclare the type
Extended = TExtendedX87;
Freely downloaded from Embarcadero's Code Central.
This unit is very well written. It uses x87 assembly code and operator
overloading to provide 80 bit fast computation under Delphi XE2 64 bit
Most of existing code base on the
Extended type can be reused
directly, or shared among both 32 bit and 64 bit versions.
gem of Philipp M. Schlüter.
Open Source and Delphi rock!