Skip to content

Commit

Permalink
Merge pull request #1151 from Alex-Jordan/zeropi
Browse files Browse the repository at this point in the history
make specialAngle return 0 when it would otherwise return 0pi
  • Loading branch information
drgrice1 authored Dec 10, 2024
2 parents 94bac43 + 1365893 commit f4e6aa7
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 f4e6aa7

Please sign in to comment.