mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 03:47:59 +02:00

constants. The default is currently 32 bits/single, which corresponds to the old behaviour (constants which cannot be exactly represented in the default/chosen precision will also still be automatically upgraded to higher precision). Supported constructs: * Command line switch -CF<x> * Compiler directive {$MINFPCONSTPREC <x>} whereby in both cases <x> can be default, 32 or 64. 80 is not supported because there is no generic way to figure out whether the current target actually supports 80 bit precision floating point calculations while parsing the command line switches (pbestreal can still change in case of win64 or -Cfsse2) git-svn-id: trunk@8349 -
28 lines
460 B
ObjectPascal
28 lines
460 B
ObjectPascal
{ %cpu=powerpc,powerpc64,sparc,arm,x86_64 }
|
|
|
|
var
|
|
l: longint;
|
|
s: single;
|
|
d: double;
|
|
|
|
begin
|
|
{$if not defined(cpux86_64) or defined(win64)} // or: using sse unit for math
|
|
l := maxlongint;
|
|
{$MINFPCONSTPREC default}
|
|
s:= l / 1.0;
|
|
d:= l / 1.0;
|
|
if (s <> d) then
|
|
halt(1);
|
|
{$MINFPCONSTPREC 32}
|
|
s:= l / 1.0;
|
|
d:= l / 1.0;
|
|
if (s <> d) then
|
|
halt(2);
|
|
{$MINFPCONSTPREC 64}
|
|
s:= l / 1.0;
|
|
d:= l / 1.0;
|
|
if (s = d) then
|
|
halt(3);
|
|
{$endif}
|
|
end.
|