C # The use of the entire function is a practical concept that we often encounter in actual development and application. How can we use C # to retrieve the entire function? First, we need to understand what is C # The use of the entire function and C # The use of the whole function.
C # example of using the entire function:
Math. Round is "rounded up nearby". When rounding 5, it is different from "Rounding 5" (taking an even number), for example:
- Math. Round (0.5, 0) = 0
- Math. Round (1.5, 0) = 2
- Math. Round (2.5, 0) = 2
- Math. Round (3.5, 0) = 4
- Math. Ceiling (3.1) = 4;
- Math. Floor (3.9) = 3;
The day plate value has nothing to do with the floor value. In fact, the result of floor is the same as that of (INT), so you can also write math. Floor (double) 2/3 + 0.5)
C # Application Analysis of the entire function
Floor and ceil are functions in math unit. Uses math is required before use.
Trunc and round are functions in system unit and can be used by default.
The floor is directly retrieved from a small value, such as floor (-123.55) =-124, floor (123.55) = 123
Trunc cut down integers directly, such as trunc (-123.55) =-123, floor (123.55) = 123
Ceil is directly retrieved from large values, such as Ceil (-123.55) =-123, Ceil (123.55) = 124
Round calculates rounding, for example, round (-123.55) =-124, round (123.55) = 124
C # Use the integer function to get the whole instance up.
- Int A=5;
- Int B=2;
-
- LBL. Text=Convert. tostring (math. Ceiling ((Double)/(Double) B ));
C # Here I will introduce you to the content related to the integer function. I hope it will be helpful for you to understand and learn the whole function of C.