Tag：Positive number

Time：2020927
Link to the original text: https://ssshooter.com/202009… The image above is from Wikipedia. IEEE754 standard is a floatingpoint number standard. There are three formats: 32bit, 64bit, and 128 bit (the above two pictures are 32bit and 64 bit respectively, and the structure is consistent). JavaScript uses 64 bit, which is commonly known as “double precision”. This […]

Time：2020713
Hi, everyone. I’m a pig. Welcome to “baby can understand” series special – 30 day leetcoding challenge. This is a small official event for leetcode. As you can see on the official website, from April 1, every day, the official will select a question and complete it within 24 hours to get a small reward. […]

Time：2020419
Given an array of unsorted integers, find the smallest positive integer that does not appear. Example 1: Input: [1,2,0]Output: 3Example 2: Input: [3,4, – 1,1]Output: 2Example 3: Input: [7,8,9,11,12]Output: 1Explain: The time complexity of your algorithm should be o (n), and only constant level space can be used. First record all the positive values with […]

Time：202026
Do you really understand negative numbers in Java? From http://blog.csdn.net/candyguy 1、 How to code negative numbers in Java? Java uses “two’s complement” to encode negative numbers. It is a numerical encoding method, which needs to be completed in two steps: first, each binary bit takes the opposite value, 0 becomes 1, 1 becomes 0. For […]

Time：2019126
1. Direct conversion float k = 1.6; int a = (int)k; NSLog(@”a = %d”,a); The output is 1, (int) is a forced type conversion, which directly discards the decimal part of the floatingpoint number. 2. Rounding of floor function (rounding down) float k = 1.6; int a = floor(k); NSLog(@”a = %d”,a); The output result […]

Time：2019920
If the operands on both sides of% are positive, the result is positive or zero; if the operands on both sides of% are negative, the result is negative or zero. Before C99, it was not stipulated what the result of modular division would be if one of the operands was negative. C99 stipulates that if […]