Skip to content

Commit d14b262

Browse files
committed
make specialAngle return 0 when it would otherwise return 0pi
1 parent 67ef44f commit d14b262

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

macros/math/specialTrigValues.pl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ =head2 Description
1717
1818
C<specialAngle(x)> returns a MathObject Formula in Numeric context of the form
1919
"a pi/c" that is the closest possible to x, where a is an integer, and c is from
20-
a specified set of positive integers. By default, c comes from [1,2,3,4,6].
20+
a specified set of positive integers. By default, c comes from [1,2,3,4,6]. If
21+
a equals 0, then this returns Formula("0").
2122
2223
=head2 Options
2324
@@ -106,7 +107,7 @@ sub specialAngle {
106107
} else {
107108
$a = $closest->[0];
108109
}
109-
my $return = Formula("$a pi $divc");
110+
my $return = ($a ne '0') ? Formula("$a pi $divc") : Formula("0");
110111
Context($mycontext);
111112
return $return;
112113
}

0 commit comments

Comments
 (0)