2
0
Эх сурвалжийг харах

* Adapted test to test for new value of min/max, from #40026

Michaël Van Canneyt 1 сар өмнө
parent
commit
10dd2297d6

+ 13 - 0
tests/test/units/math/tminmaxconst.pp

@@ -3,6 +3,9 @@ uses
 var
   s: Single;
   d: Double;
+{$if sizeof(extended) <> sizeof(double)}
+  e: Extended;
+{$endif}
 begin
   s := MaxSingle;
   d := MaxDouble;
@@ -20,5 +23,15 @@ begin
   Writeln(IntToHex(PInt64(@d)^, 16));
   if IntToHex(PInt64(@d)^, 16)<>'0010000000000000' then
     halt(4);
+{$if sizeof(extended) <> sizeof(double)}
+  e := MinExtended;
+  Writeln(IntToHex(TExtended80Rec(e)._Exp)+IntToHex(TExtended80Rec(e).Frac));
+  if IntToHex(TExtended80Rec(e)._Exp)+IntToHex(TExtended80Rec(e).Frac)<>'00018000000000000000' then
+    halt(5);
+  e := MaxExtended;
+  Writeln(IntToHex(TExtended80Rec(e)._Exp)+IntToHex(TExtended80Rec(e).Frac));
+  if IntToHex(TExtended80Rec(e)._Exp)+IntToHex(TExtended80Rec(e).Frac)<>'7FFEFFFFFFFFFFFFFFFF' then
+    halt(6);
+{$endif}
   writeln('ok');
 end.