js/src/tests/test262/ch12/12.9/S12.9_A4.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 // Copyright 2009 the Sputnik authors.  All rights reserved.
     2 // This code is governed by the BSD license found in the LICENSE file.
     4 /**
     5  * The production ReturnStatement : return Expression; is evaluated as:
     6  * i)   Evaluate Expression.
     7  * ii)  Call GetValue(Result(2)).
     8  * iii) Return (return, Result(3), empty)
     9  *
    10  * @path ch12/12.9/S12.9_A4.js
    11  * @description Return very sophisticated expression and function
    12  */
    14 // second derivative 
    15 function DD_operator(f, delta){return function(x){return (f(x+delta)-2*f(x)+f(x-delta))/(delta*delta)};}
    17 DDsin = DD_operator(Math.sin, 0.00001);
    20 //////////////////////////////////////////////////////////////////////////////
    21 //CHECK#1
    22 // ((sin(x))')' = -sin(x)
    23 if (DDsin( Math.PI/2 ) + Math.sin( Math.PI/2 ) > 0.00001) {
    24 	$ERROR('#1: return Expression yields to Return (return, GetValue(Evaluate Expression), empty)');
    25 }
    26 //
    27 //////////////////////////////////////////////////////////////////////////////

mercurial