• ## Python’s case of finding the square root by dichotomy

Time：2021-10-15

I’ll stop talking nonsense. Let’s look at the code directly~ ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 def sq2(x,e):   e = E error range   low= 0   high = max(x,1.0）Treatment greater than0less than1Number of   guess = (low + high) / 2.0   ctr = 1      while […]

• ## Self study in Java – mathematical methods of numbers and strings

Time：2020-1-22

Common methods of Java math class Java.lang.math provides some common mathematical operation methods, and they all exist in the form of static methods Step 1:Rounding, random number, square, power, π, natural constant package digit; public class TestNumber { public static void main(String[] args) { float f1 = 5.4f; float f2 = 5.5f; //5.4 rounding to […]

• ## Math object of native JS

Time：2019-12-26

1. Comparison method (common) Math. Min() // the minimum value in a set of numbers cannot be an array, an object, etc. Math. Max() // find the maximum value of a set of numbers eg: math. Min (5,3,5) // 3 2. Rounding (common) Math. Ceil() // round up Math. Round() // round Math. Floor() // […]