Archive for November, 2007

Web site management - M Math.sinh() (Simulated functionality) This function returns

Thursday, November 15th, 2007

M Math.sinh() (Simulated functionality) This function returns the sine of the input argument. The argument value must be expressed in radians. Special boundary conditions that affect the results are: Argument Result +infinity NaN -infinity NaN 0 0 NaN NaN The exact value yielded by this function may vary slightly from implementation to implementation, due to differences in the underlying precision of the implementations, math routines, and the specific algorithm selected to evaluate this function. Warnings: . Note that Math.sin(Math.PI/2) may not yield exactly 1. Math object, Math.acos(), Math.asin(), Math.atan(), Math.atan2(), Math.cos(), Math.PI, Math.tan(), Trigonometric function See also: Cross-references: ECMA 262 edition 2 section 15.8.2.16 ECMA 262 edition 3 section 15.8.2.16 Math.sinh() (Simulated functionality) The sinh() function is not available in JavaScript but can be simulated to aid in the porting of existing code. The example demonstrates how to add the sinh() method to the Math object. Example code: See also: Math.cosec(), Math.cot() Math.sin() (Function) The sine of the passed in value. Availability: ECMAScript edition 2 JavaScript 1.0 JScript 1.0 Internet Explorer 3.02 Netscape 2.0 Netscape Enterprise Server 2.0 Opera 3.0 Property/method value type: Number primitive JavaScript syntax: -Math.sin(aValue) Argument list: aValue An angle measured in radians 1418

M Math.round() (Function) Warnings: (Apache web server) . Although this

Wednesday, November 14th, 2007

M Math.round() (Function) Warnings: . Although this is noted as being available in Netscape 2.02, that only applies to the Unix platform. It wasn’t widely available until JavaScript 1.1 was supported in Netscape 3.0 on the remaining platforms. See also: Math object, Pseudo-random numbers Cross-references: ECMA 262 edition 2 section 15.8.2.14 ECMA 262 edition 3 section 15.8.2.14 Math.round() (Function) Rounds to the nearest integer value. Availability: Property/method value type: JavaScript syntax: Argument list: This function returns the value that is closest to the argument and is a mathematical integer. It rounds the input value to the nearest integer value either rounding up or down as necessary. If the input value is equi-distant from two integer values, the result is rounded up towards positive infinity. If the argument is already an integer, the argument itself is returned. Special boundary conditions that affect the results are: ECMAScript edition 2 JavaScript 1.0 JScript 1.0 Internet Explorer 3.02 Netscape Navigator 2.0 Netscape Enterprise Server 2.0 Opera 3.0 Number primitive -Math.round(aValue) aValue A meaningful numeric value Argument Result +infinity +infinity -0.5 < arg < 0.5 0 -infinity -infinity 0 0 NaN NaN Note that Math.round(3.5)returns the value 4 while Math.round(-3.5) returns the value 3. See also: Integer arithmetic, Integer-value-remainder, Math object, Math.ceil(), Math.floor(), Number(), Type conversion 1417

JavaScript Programmer’s Reference myArray[31-myEnum] = “0″; } } (Christian web host)

Tuesday, November 13th, 2007

JavaScript Programmer’s Reference myArray[31-myEnum] = “0″; } } return myArray.join(”"); } See also: Math object, Math.sqrt(), Power function, Zero value Cross-references: ECMA 262 edition 2 section 15.8.2.13 ECMA 262 edition 3 section 15.8.2.13 Math.random() (Function) Generates a pseudo-random value. Availability: ECMAScript edition 2 JavaScript 1.1 JScript 1.0 Internet Explorer 3.02 Netscape 2.02 Netscape Enterprise Server 2.0 Opera 3.0 Property/method value type: Number primitive JavaScript syntax: -Math.random() The Math.random() function generates and returns a pseudo-random value; a positive value between 0 and 1. The resulting value is chosen randomly (or pseudo randomly) depending on the implementation. In any case, regardless of how it is selected, it should yield a uniform distribution over the range of possible values. The exact value yielded by this function may vary slightly from implementation to implementation, due to differences in the underlying precision of the implementations, math routines, and the specific algorithm selected to generate the random numbers. Some implementations may provide a way to seed the random number sequence although the ECMAScript standard does not describe this capability. Some implementations provide predictable series of random numbers that always start at the same seed point. The algorithm and strategy is implementation dependent and the standard offers no recommendations as to which is best. 1416

M Math.pow() (Function) Argument1 Argument2 Result abs(arg) (Freelance web design)

Tuesday, November 13th, 2007

M Math.pow() (Function) Argument1 Argument2 Result abs(arg) < 1 -infinity +infinity abs(arg) == 1 +infinity NaN abs(arg) == 1 -infinity NaN abs(arg) > 1 +infinity +infinity abs(arg) > 1 -infinity 0 Any value 0 1 Any value NaN NaN NaN non zero NaN The exact value yielded by this function may vary slightly from implementation to implementation, due to differences in the underlying precision of the implementations, math routines, and the specific algorithm selected to evaluate this function. The example shows a simple binary number converter which exhibits some instability in the most significant bit on some platforms. Warnings: . There are many boundary conditions that make this function hard to understand and therefore hard to diagnose if it goes wrong. Check both of the input arguments in case of doubt. They may have evaluated out to a strange boundary condition that yields unexpected results. . Using MSIE on the Macintosh exhibits a instability when you raise 2 to the power 31 and test the resulting value in a bitwise expression. Netscape works correctly in this circumstance. This is demonstrated in the example. Example code: