As an example of the parameter double type
The first thing to note is that its return value type is long, and if Math.Round (11.5f), then its return value type is int, which can be referenced by the API second returns the closest long to the Argument, with the ties rounding to positive infinity it returns a Long value closest to the parameter (for example: Math.Round (11.6) =; Math.Round (-11.6) =-12; Math.Round ( -0.1) = 0; Math.Round (0.1) = 0), if there is the same number of upward downward distance, such as 11.5 in the title, how to deal with it, do not worry, look at the second half of the sentence, with the ties rounding to Positi ve infinity (at the same time to the positive and infinite direction of the choice or translation into a larger value, the English language is poor, can only be translated into such; Example: math.round (11.5) , first with 11.5 the nearest two integers 11 and 12, the larger result is a math.round (-11.5), first with 11.5 closest to two integers-11 and-12, the larger the result is -11; &nb Sp; math.round (0.5), first with 0.5 nearest two integers 0 and 1, the larger result is 1; math.round (-0.5), first with 0.5 nearest two integers-1 and 0, the larger result is 0; then it has three exceptions: 1. If the argument is NaN (Infinity and Non-numeric), then the result is 0. 2. If the parameter is negative infinity or any value less than or equal to long.min_value, the result is equal to the Long.min_value value. 3. If the parameter is positive infinity or any value greater than or equal to long.max_value, the result is equal to the Long.max_value value. Last   it is better to look at the API or the source code, do not believe my evil
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service