Archive for February, 2008

Virtual web hosting - JavaScript Programmer’s Reference Number.NEGATIVE_INFINITY (Constant/static) A mathematical constant

Friday, February 22nd, 2008

JavaScript Programmer’s Reference Number.NEGATIVE_INFINITY (Constant/static) A mathematical constant value. Availability: ECMAScript edition 2 JavaScript 1.1 JScript 1.0 Internet Explorer 3.02 Netscape 3.0 Netscape Enterprise Server 2.0 Opera 3.0 Property/method value type: Number primitive JavaScript syntax: -Number.NEGATIVE_INFINITY This is a constant representing the value negative infinity. It should be identical to a negative sign placed in front of the Infinity value provided as a property of the Global object in an ECMA- compliant implementation. Refer to the Infinity topic for further discussion. Warnings: . Netscape 2.02 does not understand what Number.NEGATIVE_INFINITY is. See also: Arithmetic constant, Infinity, Number.constructor, Special number values Property attributes: ReadOnly, DontDelete, DontEnum. Cross-references: ECMA 262 edition 2 section 15.7.3.5 ECMA 262 edition 3 section 15.7.3.5 O’Reilly JavaScript Definitive Guide page 37 Wrox Instant JavaScript page 15 1558

N Number.NaN (Adult web hosting) (Constant/static) Property attributes: ReadOnly, DontDelete,

Friday, February 22nd, 2008

N Number.NaN (Constant/static) Property attributes: ReadOnly, DontDelete, DontEnum. Cross-references: ECMA 262 edition 2 section 15.7.3.3 ECMA 262 edition 3 section 15.7.3.3 O’Reilly JavaScript Definitive Guide page 37 Number.NaN (Constant/static) A mathematical constant value. Availability: ECMAScript edition 2 JavaScript 1.1 JScript 1.0 Internet Explorer 3.02 Netscape 3.0 Netscape Enterprise Server 2.0 Opera 3.0 Property/method value type: Number primitive JavaScript syntax: -Number.NaN This is a value representing invalid numeric values. It should be identical to the NaN value provided by the Global object in an ECMA-compliant implementation. Refer to the coverage of the NaN topic for full details. However, it is generally considered unreliable to compare against NaN values with a simple equality test. To reliably test whether a numeric value is NaN or a good numeric value, use the isNaN() function and select an appropriate action according to its result. See also: Arithmetic constant, NaN, Number.constructor, Special number values Property attributes: ReadOnly, DontDelete, DontEnum. Cross-references: ECMA 262 edition 2 section 15.7.3.4 ECMA 262 edition 3 section 15.7.3.4 O’Reilly JavaScript Definitive Guide page 37 1557

JavaScript Programmer’s Reference Warnings: . The word approximately (Web hosting comparison)

Thursday, February 21st, 2008

JavaScript Programmer’s Reference Warnings: . The word approximately is used when describing the result, because the mathematical accuracy of JavaScript implementations leaves something to be desired and there are some strange artifacts in some of the calculations. See also: Arithmetic constant, Floating point constant, Number, Number.constructor, Special number values Property attributes: ReadOnly, DontDelete, DontEnum. Cross-references: ECMA 262 edition 2 section 15.7.3.2 ECMA 262 edition 3 section 15.7.3.2 O’Reilly JavaScript Definitive Guide page 37 Number.MIN_VALUE (Constant/static) A mathematical constant value. Availability: ECMAScript edition 2 JavaScript 1.1 JScript 1.0 Internet Explorer 3.02 Netscape 3.0 Netscape Enterprise Server 2.0 Opera 3.0 Property/method value type: Number primitive JavaScript syntax: -Number.MIN_VALUE This is a constant value representing the smallest realizable non-zero positive value of the number type. The resulting value is approximately 5e-324 Warnings: . Although the MAX_VALUE is generally correct across implementations there are variations in the value of the MIN_VALUE constant. See also: Arithmetic constant, Floating point constant, Number, Number.constructor, Special number values 1556

N Number.constructor (Property) Number.constructor (Property) A reference (Sex offenders web site)

Wednesday, February 20th, 2008

N Number.constructor (Property) Number.constructor (Property) A reference to a constructor object. Availability: ECMAScript edition 2 JavaScript 1.1 JScript 1.0 Internet Explorer 3.02 Netscape 3.0 Property/method value type: Number object JavaScript syntax: -myNumber.constructor The initial value of the Number constructor is the built in Number object. You can use this as one way of creating number objects although it is more popular to use the new Number() technique. This property is useful if you have an object that you want to clone but you don’t know what sort of object it is. Simply access the constructor belonging to the object you have a reference to. Netscape provides constructors for many objects, virtually all of them in fact, even when it is highly inappropriate to do so. MSIE is far more selective, and there are some occasions when you might wish for a constructor that is not available in MSIE. Number.MAX_VALUE, Number.MIN_VALUE, Number.NaN, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY, Number.prototype See also: Cross-references: ECMA 262 edition 2 section 15.7.2 ECMA 262 edition 3 section 15.7.2 Number.MAX_VALUE (Constant/static) A mathematical constant value. Availability: ECMAScript edition 2 JavaScript 1.1 JScript 1.0 Internet Explorer 3.02 Netscape 3.0 Netscape Enterprise Server 2.0 Opera 3.0 Property/method value type: Number primitive JavaScript syntax: -Number.MAX_VALUE This is a constant value representing the largest realizable positive finite value of the Number type. The value is approximately 1.7976931348623157e+308. 1555

Web hosting control panel - JavaScript Programmer’s Reference Value Result Object Internally, a

Wednesday, February 20th, 2008

JavaScript Programmer’s Reference Value Result Object Internally, a conversion to one of the primitive types happens followed by a conversion from that type to a number. Some objects will return a number that is readily usable; others will return something that cannot be converted and NaN will result. The result is a number value that is equivalent to the value of the passed in argument. If the argument is omitted the value 0 is returned. Warnings: . When converting strings to numbers, the number of digits in the numeric string is significant. If it exceeds the accuracy that the numeric storage can cope with, the value needs to be rounded before conversion. This is an area where the implementations are notoriously weak. MSIE apparently does a better job than Netscape. However, both are undergoing revision and its possible that the new versions of each will cope better than the older ones did. See also: Cast operator, Constructor function, constructor property, Implicit conversion, Math.ceil(), Math.floor(), Math.round(), Number.prototype, String() Cross-references: ECMA 262 edition 2 section 15.1.3.6 ECMA 262 edition 2 section 15.7.1 ECMA 262 edition 3 section 15.7.1 Wrox Instant JavaScript page 36 Number.Class (Property/internal) Internal property that returns an object class. Availability: ECMAScript edition 2 This is an internal property that describes the class that a Number object instance is a member of. The reserved words suggest that in the future, this property may be externalized. See also: Class, Number object Property attributes: DontEnum, Internal. Cross-references: ECMA 262 edition 2 section 8.6.2 ECMA 262 edition 2 section 15.7.2.1 ECMA 262 edition 3 section 8.6.2 1554

N Number() (Function) Warnings: . Note that

Tuesday, February 19th, 2008

N Number() (Function) Warnings: . Note that unlike the Object()constructor, which can be called without its parentheses, calling the Number() constructor without them yields an uninitialized object. See also: Constructor function, constructor property, Global object, new, Number.prototype, Object constant, Object() Cross-references: ECMA 262 edition 2 section 15.1.3.6 ECMA 262 edition 2 section 15.7.1 ECMA 262 edition 2 section 15.7.3.1 ECMA 262 edition 3 section 15.7.2 Number() (Function) A Number type convertor. Number(aValue) - aValue A value to be converted to a number. When the Number() constructor is called as a function, it will perform a type conversion. The following values are yielded as a result of calling Number() as a function: Argument list: Availability: ECMAScript edition 2 JavaScript 1.2 JScript 1.0 Internet Explorer 3.02 Netscape 4.0 Property/method value type: Number primitive -Number()JavaScript syntax: Value Result No value 0 Undefined Returns NaN Null 0 Boolean false 0 Boolean true 1 Number No conversion, the input value is returned unchanged. Non numeric string NaN Numeric string The numeric value rounded down if the number of digits exceeds the numeric accuracy specified by Number.MAX_VALUE. Table continued on following page 1553

JavaScript Programmer’s Reference Method JavaScript (Web hosting services) JScript N IE

Monday, February 18th, 2008

JavaScript Programmer’s Reference Method JavaScript JScript N IE Opera NES ECMA Notes toExponential() 1.5 + 5.5 + 6.0 + 5.5 + 3 + - toFixed() 1.5 + 5.5 + 6.0 + 5.5 + 3 + - toLocaleString() 1.5 + 5.5 + 6.0 + 5.5 + 3 + Warning toPrecision() 1.5 + 5.5 + 6.0 + 5.5 + 3 + - toSource() 1.3 + 4.06 + 3 + - toString() 1.1 + 1.0 + 3.0 + 3.02 + 3.0 + 2 + - valueOf() 1.1 + 3.0 + 3.0 + 4.0 + 2 + - Cross-references: ECMA 262 edition 2 section 4.3.20 ECMA 262 edition 2 section 10.1.5 ECMA 262 edition 2 section 15.7 ECMA 262 edition 3 section 4.3.21 ECMA 262 edition 3 section 10.1.5 ECMA 262 edition 3 section 15.7 Wrox Instant JavaScript page 33 Number() (Constructor) A Number object constructor. Availability: ECMAScript edition 2 JavaScript 1.1 JScript 1.0 Internet Explorer 3.02 Netscape 3.0 Property/method value type: Number object -new Number()JavaScript syntax: -new Number(aValue) Argument list: aValue A value to be converted to a Number object The Number() constructor is used to manufacture a new instance of the built-in Number object converting the input value to a number as it instantiates the new object. The value of the Number object when the constructor is called in a new expression is the same as value yielded by the type conversion function call. Refer to the Number()Function topic for a table of rules for converting non-number values to Number objects. The result is a Numberobject whose value is equivalent to the that of the passed-in argument. If the value is omitted, the Number object will assume a value of 0.

Web design online - N Number object (Object/core) Number objects are

Monday, February 18th, 2008

N Number object (Object/core) Number objects are created by cloning the built-in Number object. This is done by calling the Number constructor with the newoperator being applied to an existing Number object. Thus: myNumber = new Number(1000); A Numberobject can be coerced to a number value and can be used anywhere where a number value would be expected. Programmers familiar with object-oriented techniques may prefer to use the Number object while procedural language programmers may implement the same functionality with a number value instead. This is an example of the flexibility of JavaScript in its ability to accommodate a variety of users from different backgrounds. The prototype for the Number prototype object is the Object prototype object. You might want to add useful methods to the Number.prototype to output numbers in unusual formats. For example you could implement a roman numeral conversion method. Adding that to the prototype would let you output year numbers in classical formats. Warnings: . The Number object provides a collection of static constant values by way of properties belonging to the integral Number object. Because the mathematical mechanisms of any application tend to be provided by the operating system, you should find that between different browsers on any particular platform, the values that these constants yield will be very consistent. . The ECMA standard lays down strict values for these properties and in general the browser manufacturers try to comply, but there is always the possibility that an implementation may use a non-compliant calculation. . However, it may not be quite so reliable across platforms. You might enumerate one of these constants as you are authoring and then hard code that value into your script. When that script is executed on another platform, even in the same browser, the internal numeric support may yield a different value. . You should always refer to the static constants using their symbolic names and not define them yourself, unless you are certain that the script is running on a platform that does not already define the constant value. See also: Constant, Limits, Native object, Number.Class, Number.prototype, Object object Property JavaScript JScript N IE Opera NES ECMA Notes constructor 1.1 + 1.0 + 3.0 + 3.02 + 2 + - prototype 1.1 + 1.0 + 3.0 + 3.02 + 3.0 + 2.0 + 2 + DontDelete, DontEnum 1551

JavaScript Programmer’s Reference Number formats (Adelphia web hosting) (.) (Definition) The

Sunday, February 17th, 2008

JavaScript Programmer’s Reference Number formats (.) (Definition) The period character is used as numeric delimiter character. ECMA describes these formats as Numeric literals. Availability: ECMAScript edition 2 See also: Decimal point (.), Numeric literal Cross-references: ECMA 262 edition 2 section 7.7.3 ECMA 262 edition 3 section 7.8.3 Number object (Object/core) An object of the class “Number”. Availability: ECMAScript edition 2 JavaScript 1.1 JScript 1.0 Internet Explorer 3.02 Netscape 3.0 Netscape Enterprise Server 2.0 Opera 3.0 -myNumber = new Number()JavaScript syntax: -myNumber = Number Object properties: constructor, prototype Class constants: MAX_VALUE, MIN_VALUE, NaN, NEGATIVE_INFINITY, POSITIVE_INFINITY Object methods: toExponential(), toFixed(), toLocaleString(), toPrecision(), toSource(), toString(), valueOf() An instance of the class Numberis created by using the new operator on the Number() constructor. The new object adopts the behavior of the built-in prototype object through the prototype- inheritance mechanisms. All properties and methods of the prototypeare available as if they were part of the instance. A number object is a member of the type Objectand is an instance of the built-in Number object. 1550

N Number (Type) There are special constants (Web hosting domain)

Saturday, February 16th, 2008

N Number (Type) There are special constants for the values Infinityand NaN. The Infinity value can be positive or negative. The NaN value represents a quantity that is known to be numeric but is not a valid value for the implementation. It can be tested for with the isNaN() function. See also: Cast operator, Floating constant, Infinity, isNaN(), JavaScript to Java values, Number.MAX_VALUE, Number.MIN_VALUE, Primitive value Cross-references: ECMA 262 edition 2 section 4.3.19 ECMA 262 edition 3 section 4.3.19 Wrox Instant JavaScript page 14 Number (Type) A native built-in type. Availability: Property/method value type: ECMAScript edition 2 Number primitive The number type defines objects that represent numbers and include the IEEE 754 NaN values in the set if the implementation is fully ECMA-compliant. The number range is huge, representing the double precision 64 bit IEEE 754 set of values. The IEEE 754 standard defines a large number of values that are considered to be not an actual number, and should be represented as NaN. Some implementations of IEEE 754 allow you to tell the difference between an overflow error and a divide by zero error. In JavaScript, all of these values are represented by a single NaNvalue and you cannot distinguish between them. The JavaScript NaN value is globally defined as a variable. The Numbertype includes the values positive and negative Infinity and, internally at least, positive and negative zero are represented as two distinct values. Cast operator, Data Type, Floating point, Fundamental data type, Hexadecimal value, IEEE 754, Infinity, Integer, NaN, Octal value, Primitive value, ToBoolean, ToInt32, ToNumber, ToObject, ToPrimitive, ToUint16, ToUint32, Type, Type conversion, valueOf() See also: Cross-references: ECMA 262 edition 2 section 4.3.19 ECMA 262 edition 2 section 8.5 ECMA 262 edition 3 section 4.3.20 ECMA 262 edition 3 section 8.5 O’Reilly JavaScript Definitive Guide page 34 1549