Tag：Floating point number

Time：2021118
This chapter mainly studies the coding methods of unsigned numbers, complements and floatingpoint numbers in the computer. By studying the actual coding methods of numbers, we can understand the range of values that can be represented by different types of data in the computer, the properties of different arithmetic operations, and know how the computer […]

Time：202118
1: Several basic types of Java keyword type Bits (8 bits, 1 byte) Value range (representing range) byte integer 8 2^7 ~ 2^71 short integer 16 2^15 ~ 2^151 int integer 32 2^31 ~ 2^311 long integer 64 2^63 ~ 2^631 float Floating point number 32 3.402823e+38 ~ 1.401298e45 double Floating point number 64 1.797693e+308~ […]

Time：20201225
When I first came into contact with programming, I liked to ask the following questions for small interview questions How do 1 ‘floating point numbers compare with zeros? How to convert a 2 ‘floating point number to an integer? Then after seven or eight years, this kind of problem should rarely appear in the interview. […]

Time：20201224
In our daily work, numerical calculation is inevitable, especially in ecommerce systems. In general, we pay special attention to this problem, but if we don’t pay attention to it, there will be big problems. There is no trivial matter related to money. The new big brother didn’t pay attention to it. He overturned his car […]

Time：20201211
Note: This paper is transferred fromPick up the star blog Regular expressions in PHP “^ D + $” // non negative integer (positive integer + 0) “^ [09] * [19] [09] * $” // positive integer “^ (( \ D +) (0 +)) $” // non positive integer (negative integer + 0) “^ – [09] […]

Time：20201210
This blog will elaborate and discuss the following contents: ●int The range of int varies between 16 bits or 32 bits according to different computers. Take 16 bits for example. The maximum value is 1111111111111, that is 65535. If 65536 occurs, it will overflow. ●Signed int Taking a 16 bit system as an example, […]

Time：20201123
Floating point size comparison var_dump(2.7 == 2.7); //bool(true) var_dump(8.1/3); //2.7 #Because of the accuracy, this comparison is not equal to var_dump(8.1/3 == 2.7); //bool(false) #This comparison is equal var_dump(round(8.1/3) == round(2.7)); //bool(true) Note: when the result of the integer operation is beyond the range of floatingpoint numberThe maximum integer value is: PHP_ INT_ MAX This […]

Time：20201026
data type Sbyte X; // 8bit, signed, represents – 128 ~ 127 Bit X; // 8bit, no sign, 0 ~ 255 Short X; // 16bit, signed integer USHORT X; // 16bit, unsigned integer Int x; // 32bit, signed integer Uint X; // 32bit, unsigned integer Long x; // 64bit, signed integer Ulong X; // 64bit, […]

Time：20201019
Read some IEEE 754 implementation of floatingpoint arithmetic related articles IEEE 754 (IEEE 7542019) Floatingpoint arithmetic Significand JavaScript floating point number trap and solution Basic field: on floating point numbers In depth analysis of floating point numbers What is the difference between quiet NaN and signaling NaN? Why is the most secure integer in JavaScript […]

Time：20201013
Author: moocnetLink:https://zhuanlan.zhihu.com/p/…Source: ZhihuThe copyright belongs to the author. For commercial reprint, please contact the author for authorization. For noncommercial reprint, please indicate the source. 1、 Check the expression of the number 1 digit: ^ [09]$ 2 ndigit number: ^ D {n}$ 3 at least n digits: ^ D {n,}$ 4 MN digits: ^ D {m, […]

Time：20201010
In SQL server, sometimes when querying data, it is necessary to limit the query time range. At this time, you need to calculate the time as follows: USE AdventureWorks2014; GO SELECT * FROM HumanResources.Employee WHERE ModifiedDate > GETDATE() – 20; For example, to get the time of the previous day, you […]

Time：20201010
11 Two ways to run code pressF5Or click Run (right arrow) 12 In the process of programming, pay attention to write notes and appropriate names (notes–Easy to find the wrong name–Easy to find) 13 “//”Represents a comment symbol 14 The annotator plays two roles: cancellation and interpretation. First, the line of code will not be […]