Skip to content

Commit

Permalink
make specialAngle return 0 when it would otherwise return 0pi
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Jordan committed Nov 28, 2024
1 parent 67ef44f commit 1365893
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions macros/math/specialTrigValues.pl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ =head2 Description
C<specialAngle(x)> 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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 1365893

Please sign in to comment.