Nan is a value type, and it is also a number. It means not a number, and this all knows what it means. The value is special, especially if Nan is a digit and is a number that is not equal to any number.
Three NaN valuesis a special value that represents the non-number (not a numbers)Type conversion fails to return Nane.g. to convert a word blue to a numeric value will fail because there is no equivalent valueNaN does not equal himselfThat is, Nan = = Nan is FalseJudge Nan using isNaN ();
Web e
);
var num5 = parseint ("a"); 70-decimal
var num6 = parseint ("0xf"); 15 16 to 15
8, the use of the number object
var num1 = number ("Hello world!"); NaN
var num2 = number (""); 0 empty string can be converted to 0 this parseint () is not the same as
var num3 = number ("000011"); One
var num4 = number (true); 1
9. Nan Usage
Alert (nan = = nan); False
alert (isNaN (NaN)); True
alert (isNaN); False is a number
alert (isNaN ("ten")); ca
Infinity (positive infinity), exceeding negative range, output-infinity (negative infinity)
[4.3.3.2]+-infinity cannot participate in numerical calculations
[4.3.3.3] Number.max_value+1!= Infinity, because the computer save up
easily accessed. The advantage of script engine cache means that you do not need to recompile the template as byte code.AspscriptfilecachesizePurpose: This attribute specifies the number of pre-compiled script files to be cached. If it is set to 0, no script files are cached. If it is set to 4294967295, all script files are cached. This attribute is used to adjust the performance, depending on the number of available memory and script file transfers.Note: When the database is configured, the va
number generated by the calculation is greater than number. max_value, it will be assigned the value number. positive_infinity, meaning no numerical value exists. Similarly, if the generated value is smaller than number. min_value, the value number. negative_infinity is also assigned, meaning that no numeric value exists. If the return value is an infinity value, the generated result cannot be used for other computations.
In fact, a special value r
double or float to represent infinity. As we learned in school, the infinite plus 1 is still infinite. If I is initialized to infinity before the loop starts, the terminate condition test (I = I + 1) is calculated as true, so that the loop will never end.
You can use any floating-point arithmetic expression that is computed as infinity to initialize I. For examp
problem. How does it feel changed after translation? Success ...)
Input: There is a n-meter-long wood, and a price table, the table is as follows:
Length I 1 2 3 4 5 6...
Price Pi 1 5 8 9 10 17...
Obviously, wood with a length of 1 meter can be bought for 1 yuan, and wood with a length of 5 meters can be sold for 10 yuan, and so on.
Output: Find a cut method to make the most money.
Obviously, the main idea of recursion is that after I cut a knife, I divided it into two sections. I sold it at th
"Nan"
Nan
False
Number object
Infinity
"Infinity"
Infinity
True
Number object
-Infinity
"-Infinity"
-Infinity
True
Number object
Value
Numeric string
Unchanged
number, and the special value is used to denote infinity ...Feel this part of the focus is to understand the floating point machine representation, as long as the clear conversion rules, can complete floating-point number and decimal decimal conversion is OK ... There is also a point where we can see the relationship between integers and floating-point numbers ...2.44 roundingRounding here by default is rounded to even, also known as the closest roun
Number is implemented using a double-precision floating point Number, the following situation is reasonable:
0.1 + 0.2 // 0.30000000000000004
3. Math
The following method is similar to the static method of the Math class in Java.
Math.pi // 3.141592653589793
Math. cos (Math. PI) //-1
3.1 convert the string into numbers: parseInt and parseFloat methods:
ParseInt ("123") = 123 (decimal conversion)
ParseInt ("010") = 8 (octal conversion)
ParseInt ("0 xCAFE") = 51966 (hexadecimal conversion)
Parse
The article does not elaborate on the specific contents of the various points of knowledge, only the main points listed, for everyone to learn the time reference, or to detect whether they are proficient in JavaScript, clear the contents of the various parts.The built-in object can be divided into Data encapsulation class object, tool class object, error class object, as follows. Data Encapsulation Class object:
Number Object
String Object
Boolean Object
Array Object
O
(overflow)
The result of the operation exceeds the maximum number that JavaScript can represent.
More than the positive maximum is expressed as Infinity
The maximum of the negative is expressed as-infinity.
Underflow (underflow)
The result of the operation is infinitely close to 0 and is smaller than the minimum value that JavaScript can represent.
Posit
a semicolon ";", the following is the full format:var t = "Hello,world";Note that JavaScript is case-sensitive;Third, JavaScriptNotesJavaScript can be divided into single-line comments and multiline comments// represents a single-line comment /* represents a multiline comment */Iv. JavaScript variablesJavaScript can be divided into global variables and local variables, declaring variables if the keyword var is represented as a local variable, it should be noted that the variable name cannot be
This section describes how to master the numbers and date types in JavaScriptDigitalEDITIn JavaScript, numbers are double-precision floating-point types double-precision 64-bit binary format IEEE 754 (that is, A number can only be between-(253-1) and 253-1). there is no specific data type for integer type. In addition to being able to represent floating-point numbers, the number type has three symbol values: + Infinity , -
I. Method of type conversion and precautions:1.Convert to boolean:(1) Using two non-operations(!) :!! 5 ==> true(2) Use a Boolean constructor:New Boolean (5) ==> trueConvert value to boolean typeFalse:0,+ 0,-0,NaN,""(Null String), Undefined, nullOther values except the preceding values are convertedTrueWhich of the following is important?:"0", new Object (), function (){}2.Convert to string type:(1) Add a Null String"":123 + "" = "123"(2) String constructor:New String (123) = "123 ".Conversions
selection of effective algorithms. For each function f (n) and time t in the following table, find the maximum number of n problems that can be solved within the time t. Assume that the algorithm used to solve the problem requires f (n) milliseconds to solve the problem.
1 second
1 minute
1 hour
1 day
1 month
1 year
1 Century
LgN
2 ^ 1000
Positive infinity
Positive
1. Character Set
Unicode characters. Each character in Javascript (Js) programs is expressed in two bytes. A 16-bit Unicode code can represent every written language commonly used on the earth.
2. Data Type
Number)
All numbers are represented in floating point format, in a 64-bit floating point format defined in the IEEE 754 standard. Note that some integer operations (such as bit operations) are performed on 32-bit integers.
Some special numerical constants:
NaN (Number. NaN), special non-numer
JS data types are divided into primitive types (num, String, Boolean), Object types (objects, collections of attributes, special objects are arrays, global objects ), primitive values (null,undefined), except for primitive values, others have methodsJS is flexible for data type conversionAttention:1, Number type: overflow in arithmetic operation, underflow, or divide by zero will not error,If the overflow result is infinite, it returns infinity, and n
JavaScript data types are divided into primitive types (primitive type) and reference types (complex type).First, the original typeJavaScript has 5 primitive types (primitive type), that is, Undefined, Null, Boolean, number, and String.1.Number typeThis type can represent both a 32-bit integer and a 64-bit floating-point number.A special number value:The first two are Number.MAX_VALUE and Number.min_value, which define the outer bounds of the set of number values. All ECMAScript numbers must be
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.