From 1365893b87a56b51fabb3403522bc2ac5d8b664e Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Wed, 27 Nov 2024 15:50:19 -0800 Subject: [PATCH] make specialAngle return 0 when it would otherwise return 0pi --- macros/math/specialTrigValues.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/macros/math/specialTrigValues.pl b/macros/math/specialTrigValues.pl index c63e2a27d0..79f9f19390 100644 --- a/macros/math/specialTrigValues.pl +++ b/macros/math/specialTrigValues.pl @@ -17,7 +17,8 @@ =head2 Description C returns a MathObject Formula in Numeric context of the form "a pi/c" that is the closest possible to x, where a is an integer, and c is from -a specified set of positive integers. By default, c comes from [1,2,3,4,6]. +a specified set of positive integers. By default, c comes from [1,2,3,4,6]. If +a equals 0, then this returns Formula('0'). =head2 Options @@ -106,7 +107,7 @@ sub specialAngle { } else { $a = $closest->[0]; } - my $return = Formula("$a pi $divc"); + my $return = ($a ne '0') ? Formula("$a pi $divc") : Formula('0'); Context($mycontext); return $return; }