changeset 24912:08c871c4147b stable

sinint(0) returns correctly signed zero output. sinint.m: return correctly signed 0, add BIST.
author Colin Macdonald <cbm@m.fsf.org>
date Tue, 23 Jan 2018 22:43:03 -0800
parents 8d6f3941a118
children 9da779d2f029
files scripts/specfun/sinint.m
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/specfun/sinint.m	Tue Jan 23 20:17:25 2018 -0800
+++ b/scripts/specfun/sinint.m	Tue Jan 23 22:43:03 2018 -0800
@@ -63,7 +63,7 @@
   i_miss = true (length (x), 1);
 
   ## Trivial values
-  y(x == 0) = 0;
+  y(x == 0) = x(x == 0);  # correctly signed zero
   y(x == Inf) = pi / 2;
   y(x == - Inf) = - pi / 2;
 
@@ -123,6 +123,7 @@
 %! assert (A, B, -5e-15);
 
 %!assert (sinint (0), 0)
+%!assert (signbit (sinint (-0)))
 %!assert (sinint (inf), pi/2)
 %!assert (sinint (-inf), -pi/2)
 %!assert (isnan (sinint (nan)))