* [LTP] [PATCH] float_trigo: Fix acos/asin/atan input generation
@ 2026-10-19 12:34 Jan Stancek via ltp
2026-10-19 19:05 ` [LTP] " linuxtestproject.agent
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jan Stancek via ltp @ 2026-10-19 12:34 UTC (permalink / raw)
To: ltp
genacos, genasin and genatan compute the step between input values as
2 / nbVal with both operands int, which evaluates to 0. Every one of the
20000 generated inputs is therefore exactly -1.0 and float_trigo only
ever checks acos(), asin() and atan() at a single point.
Use 2.0 / nbVal so the inputs are spread over [-1, 1) as intended.
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
testcases/misc/math/float/trigo/genacos.c | 4 ++--
testcases/misc/math/float/trigo/genasin.c | 4 ++--
testcases/misc/math/float/trigo/genatan.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/testcases/misc/math/float/trigo/genacos.c b/testcases/misc/math/float/trigo/genacos.c
index 2ad051d26c1c..b15c44d8ff32 100644
--- a/testcases/misc/math/float/trigo/genacos.c
+++ b/testcases/misc/math/float/trigo/genacos.c
@@ -48,7 +48,7 @@ static int create_Result_file(void)
F_name = "racos";
nbVal = 20000;
- Inc = 2 / nbVal;
+ Inc = 2.0 / nbVal;
for (i = 0; i < nbVal; i++)
tabRacos[i] = acos((Inc * i) - 1);
@@ -78,7 +78,7 @@ static int create_Data_file(void)
F_name = "dacos";
nbVal = 20000;
- Inc = 2 / nbVal;
+ Inc = 2.0 / nbVal;
for (i = 0; i < nbVal; i++)
tabDacos[i] = -1 + (Inc * i);
diff --git a/testcases/misc/math/float/trigo/genasin.c b/testcases/misc/math/float/trigo/genasin.c
index 4614180e8cca..586bd22d72eb 100644
--- a/testcases/misc/math/float/trigo/genasin.c
+++ b/testcases/misc/math/float/trigo/genasin.c
@@ -48,7 +48,7 @@ static int create_Result_file(void)
F_name = "rasin";
nbVal = 20000;
- Inc = 2 / nbVal;
+ Inc = 2.0 / nbVal;
for (i = 0; i < nbVal; i++)
tabRasin[i] = asin((Inc * i) - 1);
@@ -78,7 +78,7 @@ static int create_Data_file(void)
F_name = "dasin";
nbVal = 20000;
- Inc = 2 / nbVal;
+ Inc = 2.0 / nbVal;
for (i = 0; i < nbVal; i++)
tabDasin[i] = (Inc * i) - 1;
diff --git a/testcases/misc/math/float/trigo/genatan.c b/testcases/misc/math/float/trigo/genatan.c
index 959b605bb884..94707c5ffd5a 100644
--- a/testcases/misc/math/float/trigo/genatan.c
+++ b/testcases/misc/math/float/trigo/genatan.c
@@ -48,7 +48,7 @@ static int create_Result_file(void)
F_name = "ratan";
nbVal = 20000;
- Inc = 2 / nbVal;
+ Inc = 2.0 / nbVal;
for (i = 0; i < nbVal; i++)
tabRatan[i] = atan((Inc * i) - 1);
@@ -78,7 +78,7 @@ static int create_Data_file(void)
F_name = "datan";
nbVal = 20000;
- Inc = 2 / nbVal;
+ Inc = 2.0 / nbVal;
for (i = 0; i < nbVal; i++)
tabDatan[i] = (Inc * i) - 1;
--
2.56.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [LTP] float_trigo: Fix acos/asin/atan input generation
2026-10-19 12:34 [LTP] [PATCH] float_trigo: Fix acos/asin/atan input generation Jan Stancek via ltp
@ 2026-10-19 19:05 ` linuxtestproject.agent
2026-10-19 19:56 ` [LTP] [PATCH] " Avinesh Kumar via ltp
2026-10-21 9:33 ` Andrea Cervesato via ltp
2 siblings, 0 replies; 5+ messages in thread
From: linuxtestproject.agent @ 2026-10-19 19:05 UTC (permalink / raw)
To: Jan Stancek; +Cc: ltp
Hi Jan,
On Mon, 19 Oct 2026, Jan Stancek via ltp wrote:
> float_trigo: Fix acos/asin/atan input generation
Verdict - Reviewed
Pre-existing issue (low severity; separate follow-up):
In genacos.c, genasin.c and genatan.c, both create_*_file() functions
test open() with if (!fp) and ignore write() failures. An output path
that is a directory therefore makes either mode report success and exit
0 without producing data, both before and after this patch. Check
fp < 0, handle write() failures and propagate failure from main().
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] float_trigo: Fix acos/asin/atan input generation
2026-10-19 12:34 [LTP] [PATCH] float_trigo: Fix acos/asin/atan input generation Jan Stancek via ltp
2026-10-19 19:05 ` [LTP] " linuxtestproject.agent
@ 2026-10-19 19:56 ` Avinesh Kumar via ltp
2026-10-21 9:33 ` Andrea Cervesato via ltp
2 siblings, 0 replies; 5+ messages in thread
From: Avinesh Kumar via ltp @ 2026-10-19 19:56 UTC (permalink / raw)
To: Jan Stancek, ltp
Hi,
Reviewed-by: Avinesh Kumar <avinesh.kumar@suse.com>
Regards,
Avinesh
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] float_trigo: Fix acos/asin/atan input generation
2026-10-19 12:34 [LTP] [PATCH] float_trigo: Fix acos/asin/atan input generation Jan Stancek via ltp
2026-10-19 19:05 ` [LTP] " linuxtestproject.agent
2026-10-19 19:56 ` [LTP] [PATCH] " Avinesh Kumar via ltp
@ 2026-10-21 9:33 ` Andrea Cervesato via ltp
2026-10-21 15:42 ` Jan Stancek via ltp
2 siblings, 1 reply; 5+ messages in thread
From: Andrea Cervesato via ltp @ 2026-10-21 9:33 UTC (permalink / raw)
To: Jan Stancek; +Cc: ltp
Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] float_trigo: Fix acos/asin/atan input generation
2026-10-21 9:33 ` Andrea Cervesato via ltp
@ 2026-10-21 15:42 ` Jan Stancek via ltp
0 siblings, 0 replies; 5+ messages in thread
From: Jan Stancek via ltp @ 2026-10-21 15:42 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp
Pushed.
On Wed, Oct 21, 2026 at 11:33 AM Andrea Cervesato
<andrea.cervesato@suse.com> wrote:
>
> Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
>
> --
> Andrea Cervesato
> SUSE QE Automation Engineer Linux
> andrea.cervesato@suse.com
>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-21 15:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 12:34 [LTP] [PATCH] float_trigo: Fix acos/asin/atan input generation Jan Stancek via ltp
2026-10-19 19:05 ` [LTP] " linuxtestproject.agent
2026-10-19 19:56 ` [LTP] [PATCH] " Avinesh Kumar via ltp
2026-10-21 9:33 ` Andrea Cervesato via ltp
2026-10-21 15:42 ` Jan Stancek via ltp
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.