Tag：Floating point number

Time：2021418
This article is mainly about some questions raised by winter and my thoughts. If there is something wrong, I hope you can point out it. 1Why do some programming specifications require void 0 instead of undefined? this article mainly introduces the attribute descriptor in JavaScript, module in ES6 and arrow function. The value of […]

Time：2021416
Write on the front Mastering regular expressions skillfully can help programmers write the most elegant code with the fastest speed. Glacier has combed and summarized the regular expressions used in many years of programming work. These regular expressions can help you save a lot of coding time. Often a simple regular expression can omit a […]

Time：2021412
Recently, there is a demand that the original integer calculation should be changed to decimal calculation, and one decimal place should be reserved.So according to the demand, the data structure is changed from int to floatround()To retain decimal places. The code of the first edition is as follows: a = 0.1000001 b = round(a+0.1,1) c […]

Time：2021411
Today of last year #Py calculates the time of last year If it’s next year, modify the code last_year = today – datetime.timedelta(days=366)Change the symbol to+ Calculate the number of days, hours and so on datetime.timedelta method datetime.timedelta Object represents the time difference between two times. Subtracting two date or datetime objects can return a […]

Time：202141
Why use output controllers: We know that in the computer, data is stored in the form of binary in the computer, but the code composed of 01 can represent both data and instructions. It’s easy to misunderstand if we don’t use the output controller to become what we want. If the code composed of 01 […]

Time：2021324
Author: Piyush KochharTranslator: XiaozhiSource: hackernoon Like again, wechat searchGreat migration to the worldPay attention to this person who does not have a big factory background, but has an upward positive attitude. this paperGitHubhttps://github.com/qq44924588… It has been included in the book, the articles have been classified, and a lot of my documents and tutorial materials have […]

Time：2021322
1. Round down: int () >>> a = 14.38 >>> int(a) 14 2. Round up: ceil () When using the ceil () method, you need to import the math module, such as >>> import math >>> math.ceil(3.33) 4 >>> math.ceil(3.88) 4 3. Round () #Python learning exchange group: 778463939 >>> round(4.4) 4 >>> round(4.6) 5 […]

Time：2021321
1、 Check the expression of the number1 digit: ^ [09]*$2 ndigit number: ^ D {n}$3 at least n digits: ^ D {n,}$4 MN digits: ^ D {m, n}$5 zero and non zero numbers: ^ (0  19 *)$6 non zero number with two decimal places at most: ^ (19 *) + (. [09] {1,2})$7 positive […]

Time：2021321
1、 Basic types (eight) All of them are reference types except those on the table. From the table, except for byte, the value range of integer type can’t be known, so we can borrow their wrapper class to call the corresponding method to get the range value. The code is as follows:Integer type corresponding to […]

Time：2021320
Carbon is a lightweight, semantic, IDE friendly date and time processing library. It is the golang implementation version of PHP carbon library. Its original intention is to get rid of golang’s antihuman 20060102 15:04:05 format time design, and support chain call and mainstream ORM such as Gorm and xrom If you think it’s good, please […]

Time：2021320
1、 Check the expression of the number1 digit: ^ [09]*$2 ndigit number: ^ D {n}$3 at least n digits: ^ D {n,}$4 MN digits: ^ D {m, n}$5 zero and non zero numbers: ^ (0  19 *)$6 non zero number with two decimal places at most: ^ (19 *) + (. [09] {1,2})$7 positive […]

Time：2021313
The hash of redis allows users to store multiple key value pairs in a redis key. Here are some common commands and their use in Yii. HMGET HMGET：HMGET keyname key [key …]Gets the value of one or more keys from the hash. HMSET HMSET：HMSET keyname key name [key name …]Set values for one or […]