Tag:digit

  • JS regular matching of integers and decimals

    Time:2021-4-17

    let _ Check = / ^ ([1-9] [D] {0,6} 0) (\. [D] {1,2}) $/; // limit the number of digits before and after the decimal point let _ Check1 = / ^ ([1-9] [D] * | 0) (\. [D] +)? $/; // do not limit the number of digits before and after the decimal point […]

  • Python 7 super practical data cleaning methods, which you must master

    Time:2021-3-23

    Data cleaning is an essential part of data analysis, in the process of analysis, there will be a lot of data that do not meet the requirements of analysis, such as duplicate, error, missing, abnormal data. 1、 Duplicate value processing Data entry process, data integration process may produce duplicate data, direct deletion is the main […]

  • Tips! Judge whether a number is the power of 4?

    Time:2021-2-24

    Long lost Shuangbai, QAQLeetcode-342 The topic said not to use loops or recursion as much as possible, so I thought of the previous judgment that a number is not a power of 2. Therefore, let’s see if there is any similarity. The power of 4 must be the power of 2, but the reverse is […]

  • High precision calculation of PHP

    Time:2021-2-4

    PHPer, who is engaged in the financial industry, has frequent capital calculation. If you don’t pay attention, the user’s capital may lose hundreds of thousands, or even more terrible javascript Why is 0.1 + 0.2 not equal to 0.3? (correct result: 0.3000000000000004) Why is 0.8 * 7 not equal to 5.6? (correct result: 5.600000000005) PHP […]

  • C — cycle

    Time:2021-1-24

    ————Resume content———— In C language, there are three loops: while loop, do – while loop and for loop.     1、 While loop While: first check whether the conditions for starting the loop are met. When the conditions are met, repeat the statements in the loop until the conditions are not met. The basic form […]

  • [Vue + element] text box component that can only input numbers and control decimal places (automatically fill in decimal place 0)

    Time:2021-1-22

    design sketch major function Only numbers and decimals can be entered You can customize the number of decimal points specified Auto fill 0 of decimal places Preparatory work There is one that can be usedElementVue project for Subcomponents staycomponents/MagicCreate under directoryNumberInput.vuefile Customize the required attribute values and events according to your own needs. Here you […]

  • Es8 (3) — string padding

    Time:2021-1-5

    catalog How to fill in white space for string padStart padEnd Es6-es10 learning map How Es5 complements string Fill white namelyformatFor example, output all the numbers into two digits, and fill in the front 0 Example 1: for(let i = 1 ; i < 32 ; i++){ console.log(i >= 10 ? i : `0${i}`) } […]

  • Leetcode002 sum of two numbers medium

    Time:2020-11-30

    Title: give twoNon emptyThe linked list of is used to represent twoNonnegativeThe integer of. Among them, their respective digits are in accordance withReverse orderAnd they can only store one digit per node. If we add these two numbers together, we will return a new linked list to represent their sum. You can assume that except […]

  • On binary (2) – four operations

    Time:2020-11-12

    (Note:SegmentfaultThe mathematical formula in the article isBUGWhen previewing, it is good. When the article is sent out, it will show that there is a problem. If you have any problem when you read it, you can move on http://www.dubingxuan.com/article/8/ ) Preface In the last article about binary system (1), we spent a lot of space, […]

  • Binary transformation of integer by go

    Time:2020-11-10

    Go has already implemented the conversion function of int > bin. Here I just implement the process logic. As for the principle, I assume that you all know it This case only considers the transformation of int > bin Contains the conversion of positive integer, negative integer, 0   package main import ( “fmt” “strconv” […]

  • Look at animation algorithm: sort cardinal sort

    Time:2020-10-28

    brief introduction In the previous article, we talked about count sorting, but there is a limitation on count sorting, because the count array is limited. If the range of elements in the array is too large, it is unrealistic to use count sort, and its time complexity will expand. And the solution to a wide […]

  • Leetcode-9. Palindrome number

    Time:2020-10-9

    Leetcode-9. Palindrome number. Determine whether an integer is a palindrome number. Palindrome number refers to the number of positive (from left to right) and reverse (from right to left) read the same integer. Example 1: Input: 121 Output: true Example 2: Input: – 121 Output: false Explanation: from left to right, it is – 121. […]