Unary operatorThe unary operator, when processing all non-numeric values, translates the value through number () to a numeric value.Bitwise operators
Negative numbers are stored in the form of twos complement on the computer, and the complement is equal to the original code's inverse code plus 1,ecmascript when you output a negative number as a binary string, we see just the binary code with the negative absolute value preceded by a symbol (instead of the output 32-bit bina
shipment count is NULL, return null
If a shipping count is Nan, return nan
If an op count is undefined, an error occurs.
The logical or in the ECMAScript is also a simple operation, that is, if the first operand determines the result, the second operand is no longer computed, and the example:
Copy Code code as follows:
var btrue=true;
var bresult=btrue| | Bunknow;
Console.log (Bresult); Outpus true
var Bfalse=false;
var bresult=bfalse| | Bunknow;
Console.log (Bresult);
and a finite number, the usual sign rules apply:When two non-infinite numbers are multiplied by "0", the usual multiplication rules can be used.
> Signed (+0 *-5)
'-0 '
> Signed (-0 *-5)
' +0 '
Multiplying an infinity with a zero results in NaN:The infinity number is multiplied by "0" and the result is not a number (NaN)
>-infinity
); // ' false ' true); // ' true 'Therefore, using the plus operator's attributes, you can convert the value of any type to a string using the ' + 'In the numerical addition operation, the processing of Infinity and signed 0 is more special.Number.MAX_VALUE + Number.MAX_VALUE = = = Infinity; // true Infinity + (-infinity
JavaScript learning notes operator (continued), javascript learning notes
I. Multiplication Operators
1. Multiplication :*
Special rules for multiplication operators:
If the operands are all numeric values, they are calculated by regular multiplication. If the product exceeds the range indicated by the ECMAscript value, infinity or-infinity is returned.If one of the operands is NaN, the returned result is N
0, return false
* If the OP count is null, return True
* If the OP count is NaN, return True
* If the OP count is undefined, there's a mistake.
!! sblue, the first not operator returns a Boolean value. The second not will be negative for this boolean value
The logical AND operation does not necessarily return a Boolean value:
* If one of the operands is an object and the other is a Boolean value, return the object.
* If two operands are objects, the second object is returned.
* If a shipment c
, as long as can fill 8 bits of the binary, you can.If you want to maximize the initial, the first bit is the sign bit, cannot be 1, the rest is all 1, that is, 7 1,1111111 to hexadecimal just for 0x7f, so memset (, 0x7f,sizeof ());the technique of setting infinite constants in MemsetIf the scope of the data in the problem is clear, then infinity is not a problem, in the case of unclear, many programmers take0x7fffffffAs infinitely large as this ismax
problems, NaN makes it possible to simply continue the loop to perform operations that have no errors, even if a loop has made such an error. You might think that, now that Java has an exception handling mechanism, you might be able to achieve the same effect by capturing and ignoring exceptions. However, you know that the IEEE standard is not designed for Java alone, and that different languages handle exceptions differently, which makes it more difficult to migrate code. Moreover, not all lan
-point type .The Java language's floating-point type defaults to a double type, and you can add D or D after a floating-point number to force the specified variable to be a double type.If you want Java to treat a floating-point type value as a float type, you should immediately follow the value of F or F after this floating-point type.Java also provides three special floating-point values, positive infinity, negative
, the first object is returned.* If the number of operations is null, null is returned.* If the number of operations is NaN, NaN is returned.Multiplication operator (*)* If the result is too large or too small, the generated result is Infinity or-Infinity.* If the number of operations is NaN, the result is NaN.* If Infinity is multiplied by 0, the result is NaN.*
, then the resulting result is Infinity or-infinity.
If a shipping count is Nan, the result is Nan.
Infinity times 0, and the result is Nan.
Infinity times any number other than 0, the result is Infinity or-infinity, determined by
Blog.aikilis.com2471.html if the range of each data in the problem is clear, the infinite limit setting is not a problem. If it is not clear, many programmers use 0x7fffffff as the infinity, because this is the largest 32-bitint. If this infinity is only used for general comparison (for example, to obtain the minimum min variable), then 0x7fffff
Http://blog.aikilis.com/2471.html if the scope of the data in
1, the representation of integers most (all?) The number of machines with symbols is a complement indication.2, integer operation. +-is +-+, bitwise plus minus, note signed and unsigned numeric overflow, */can be converted to shift and so on is also a bit truncation, you can first decimal calculation to 2 binary and then truncated.3, is actually a kind of modulo operation, notice the word length causes truncation.4, the expression of floating-point number:Single Precision For example: 32-bit, 1-
Python built-in functions (22) -- float, python built-in 22 float
English document:
Classfloat([X])
Return a floating point number constructed from a number or stringX.
If the argument is a string, it shoshould contain a decimal number, optionally preceded by a sign, and optionally embedded in whitespace. The optional sign may be'+'Or'-';'+'Sign has no effect on the value produced. the argument may also be a string representing a NaN (not-a-number), or a positive or negative
exponent part of the special infinity value is alsoEMax + 1 = 128, but the infinite ending number field must be zero. Infinity is used to express the overflow problem in computing. For example, when two extremely large numbers are multiplied, although the two operands can be saved as floating-point numbers, the result may be as large as it cannot be saved as a floating-point number, but must be rounded. Ac
One, multiplicative operator
1, Multiplication: *
Some special rules for multiplication operators:
If the operands are numeric, the normal multiplication calculates that if the product exceeds the representation range of the ECMAScript value, return infinity or-infinityIf one operand is Nan, then the return result is NanIf infinity is multiplied by 0, return NanIf the
This article describes the attributes and methods of the Number object of the JavaScript native object. This article describes the syntax, MAX_VALUE, MIN_VALUE, NaN, and other attributes or methods for creating the Number object, for more information, see
Syntax for creating a Number object:
The Code is as follows:
Var myNum = new Number (value );Var myNum = Number (value );
When Number () and operator new are used as constructors, it returns a newly created Number object. If the new operator i
To create the syntax for a number object:
Copy Code code as follows:
var myNum = new number (value);
var myNum = number (value);
When number () and operator new are used together as constructors, it returns a newly created number object. If you do not use the new operator to call number () as a function, it converts its arguments to an original numeric value and returns this (NaN) if the conversion fails.
Max_value
The Max_value property is the largest number that can
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.