From 39a4daf955c1b431a0fdc7f664e40208ef3b622d Mon Sep 17 00:00:00 2001 From: Boris Yakobowski Date: Wed, 23 May 2018 10:23:43 +0000 Subject: [PATCH] [Ada] Fix faulty preconditions for trigonometric functions 2018-05-23 Boris Yakobowski gcc/ada/ * libgnat/a-ngelfu.ads (Arctanh, Arccoth): Fix faulty preconditions. From-SVN: r260595 --- gcc/ada/ChangeLog | 4 ++++ gcc/ada/libgnat/a-ngelfu.ads | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5a34dee..f2e6fde 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2018-05-23 Boris Yakobowski + + * libgnat/a-ngelfu.ads (Arctanh, Arccoth): Fix faulty preconditions. + 2018-05-23 Arnaud Charlet * checks.adb (Minimize_Eliminate_Overflows): Default initialize Lo and diff --git a/gcc/ada/libgnat/a-ngelfu.ads b/gcc/ada/libgnat/a-ngelfu.ads index 97b22c7..5a58d83 100644 --- a/gcc/ada/libgnat/a-ngelfu.ads +++ b/gcc/ada/libgnat/a-ngelfu.ads @@ -196,10 +196,10 @@ is and then (if X = 1.0 then Arccosh'Result = 0.0); function Arctanh (X : Float_Type'Base) return Float_Type'Base with - Pre => abs X /= 1.0, + Pre => abs X < 1.0, Post => (if X = 0.0 then Arctanh'Result = 0.0); function Arccoth (X : Float_Type'Base) return Float_Type'Base with - Pre => X <= 1.0 and abs X /= 1.0; + Pre => abs X > 1.0; end Ada.Numerics.Generic_Elementary_Functions; -- 2.7.4