mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-22 18:38:17 +02:00
* disable range/overflow checking when calculating with Nan
git-svn-id: trunk@9649 -
This commit is contained in:
parent
2092bb5229
commit
f6384b9361
@ -1976,7 +1976,16 @@ end;
|
|||||||
Julian and Modified Julian Date conversion support
|
Julian and Modified Julian Date conversion support
|
||||||
---------------------------------------------------------------------}
|
---------------------------------------------------------------------}
|
||||||
|
|
||||||
{$warnings off}
|
{$ifopt R+}
|
||||||
|
{$define RangeCheckWasOn}
|
||||||
|
{$R-}
|
||||||
|
{$endif opt R+}
|
||||||
|
|
||||||
|
{$ifopt Q+}
|
||||||
|
{$define OverflowCheckWasOn}
|
||||||
|
{$Q-}
|
||||||
|
{$endif opt Q+}
|
||||||
|
|
||||||
Function DateTimeToJulianDate(const AValue: TDateTime): Double;
|
Function DateTimeToJulianDate(const AValue: TDateTime): Double;
|
||||||
begin
|
begin
|
||||||
DateTimeToJulianDate := AValue - JulianEpoch;
|
DateTimeToJulianDate := AValue - JulianEpoch;
|
||||||
@ -2015,7 +2024,16 @@ Function TryModifiedJulianDateToDateTime(const AValue: Double; var ADateTime: TD
|
|||||||
begin
|
begin
|
||||||
NotYetImplemented('TryModifiedJulianDateToDateTime');
|
NotYetImplemented('TryModifiedJulianDateToDateTime');
|
||||||
end;
|
end;
|
||||||
{$warnings on}
|
|
||||||
|
{$ifdef RangeCheckWasOn}
|
||||||
|
{$R+}
|
||||||
|
{$undef RangeCheckWasOn}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
{$ifdef OverflowCheckWasOn}
|
||||||
|
{$Q+}
|
||||||
|
{$undef OverflowCheckWasOn}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
{ ---------------------------------------------------------------------
|
{ ---------------------------------------------------------------------
|
||||||
Unix timestamp support.
|
Unix timestamp support.
|
||||||
@ -2064,7 +2082,7 @@ end;
|
|||||||
|
|
||||||
Function MacTimeStampToUnix(const AValue: Int64): Int64;
|
Function MacTimeStampToUnix(const AValue: Int64): Int64;
|
||||||
const
|
const
|
||||||
Epoch=24107 * 24 * 3600;
|
Epoch=24107 * 24 * 3600;
|
||||||
begin
|
begin
|
||||||
Result:=AValue - Epoch;
|
Result:=AValue - Epoch;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user