Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make specialAngle return 0 when it would otherwise return 0pi #1151

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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