Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(807)

Side by Side Diff: test/mjsunit/sin-cos.js

Issue 6659034: Fix error in sin-cos.js test introduced in r7129. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 15 matching lines...) Expand all
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 // Test Math.sin and Math.cos. 28 // Test Math.sin and Math.cos.
29 29
30 function sinTest() { 30 function sinTest() {
31 assertEquals(0, Math.sin(0)); 31 assertEquals(0, Math.sin(0));
32 assertEquals(1, Math.sin(Math.PI / 2)); 32 assertEquals(1, Math.sin(Math.PI / 2));
33 } 33 }
34 34
35 function cosTest() { 35 function cosTest() {
36 assertEquals(0, Math.cos(1)); 36 assertEquals(1, Math.cos(0));
37 assertEquals(-1, Math.cos(Math.PI)); 37 assertEquals(-1, Math.cos(Math.PI));
38 } 38 }
39 39
40 sinTest(); 40 sinTest();
41 cosTest(); 41 cosTest();
42 42
43 // By accident, the slow case for sine and cosine were both sine at 43 // By accident, the slow case for sine and cosine were both sine at
44 // some point. This is a regression test for that issue. 44 // some point. This is a regression test for that issue.
45 var x = Math.pow(2, 70); 45 var x = Math.pow(2, 70);
46 assertTrue(Math.sin(x) != Math.cos(x)); 46 assertTrue(Math.sin(x) != Math.cos(x));
47 47
48 // Ensure that sine and log are not the same. 48 // Ensure that sine and log are not the same.
49 x = 0.5; 49 x = 0.5;
50 assertTrue(Math.sin(x) != Math.log(x)); 50 assertTrue(Math.sin(x) != Math.log(x));
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698