Permalink
Browse files

fixing bug: asin(0) = exact 0

  • Loading branch information...
1 parent d7fd36e commit 185e321241353ba9f958491265baab84c4734dd4 Danny Yoo committed Jun 27, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −0 src/js-numbers.js
  2. +1 −2 test/tests.js
View
1 src/js-numbers.js
@@ -659,6 +659,7 @@ if (typeof(exports) !== 'undefined') {
// asin: scheme-number -> scheme-number
var asin = function(n) {
+ if (eqv(n, 0)) { return 0; }
if (typeof(n) === 'number') {
return FloatPoint.makeInstance(Math.asin(n));
}
View
3 test/tests.js
@@ -3574,8 +3574,7 @@ describe('old tests from Moby Scheme', {
},
testAsin : function(){
- assertTrue(equals(asin(0),
- 0));
+ assertTrue(eqv(asin(0), 0));
assertTrue(equals(asin(-1),
multiply(pi, makeRational(-1, 2))));
assertTrue(equals(asin(1),

0 comments on commit 185e321

Please sign in to comment.