Codecore Logo
Quick Search
»
Advanced Search »

Number Data Type

RSS
Represents a signed IEEE 64-bit (8-byte) double-precision floating-point number ranging in value from -1.79769313486231570E+308 through -4.94065645841246544E-324 for negative values and from 4.94065645841246544E-324 through 1.79769313486231570E+308 for positive values.


Constructors

Number ( )

Initializes a new Number instance with a value of 0 (zero). This has the same affect as using a numeric literal with a value of zero.

Syntax:

Number()

Example:


i = new Number( ); // results in 0
// is equivalent to
i = 0;

Number ( Number )

Initializes a new Number instance to the specified number value.

Syntax:

Number( Number value )

Parameters:

value: A Number.

Example:


i = new Number( 5.25 );
// is equivalant to
i = 5.25;

Number ( String )

Initializes a new Number instance by converting the specified string to a number.

Syntax:

String( String value )

Parameters:

value: A String.

Example:


s = "5.25";
i = new Number( s );

Number ( Boolean )

Initializes a new Number instance by converting a boolean to a number. false results in 0 (zero), and true results in 1.

Syntax:

String( Boolean value )

Parameters:

value: A Boolean.

Example:


b = true;
i = new Number( b ); // results in 1

Instance Methods

Privacy Policy | Conditions Of Use

Copyright ©2014 Codecore Technologies, All rights reserved.