Select the product you need help with
????? ????? ???? ??????? ??????????? ???????: 196652 - ??? ???????? ???? ????? ????? ??? ???????. ?? ??? ???????????????? ??? ?? ????????? ??????? ?????? ?? ?????? Microsoft. ??????? ???? ????????? ?? "????? ???????" ???????? ?? ???? Round() ???? ??? ?? Excel ??? Rounding ????? ????? ?? ????? CInt() ? CLng() Round() ?? Visual Basic for Applications. ???? ??? ??????? ?? ???????? Visual Basic for Applications ????? ??????? ??? ???? ????? ?? ??????? ???????. ???????? ??? ???? ????? ??? ??????? ??? ???????? ????? ????? ????? ????? ????????? ??????? ????????. ??????? ??????????? ??????? ????? ????? ???? ?? ????? ??? ?? ????? ???? ??? ??? ?? ??? ???. ?????? ?????? ?????? ????? ????? ??? ????? ??? ??????? ????? ??? ??? ????.??????? ??????? ???? ????? ?? ??????? ????????. ??? ?????? ????? ??? ????? ??? ????? ????????. ???? VBA Fix() ?????? ????????. ??? ???? ??????? Fix(3.5) 3 ???? Fix(-3.5) ?? 3.????? ?????? Int() ??? ??? ???? ???? ??? ?? ??????. ?? Int() ? Fix() ???? ???? ??????? ?? ????? ????? - ?????? - ???? ???? ????? ?????? ??????? ???????: Int(-3.5) ????-4. ???? Fix() ?????? ??????? ???????? ???? ???? ?????? (?????? ???????) ??????? ??????? ???????? ???? ???????. ???? Int() ?????? ??????? ??? ????????? ???? ???? ?????? ??????? ??????? ???????? ???? ?????. ????? Excel ????? ???? ???????? ?????????: Int() ? Floor() RoundDown(). ???? Int() ???? ??????? ??? ???? Int() ?? Visual Basic for Applications. ?????? ????? ??????? Floor() ???? ?? ???? ?? ??????? ???????. ???? ???? RoundDown() ???? ???? VBA Fix() ???????. ????? Microsoft SQL Server ???? Round() ???? ???? ?? ???? ??? ???? VBA Fix(). ????? SQL Server ????? ???? Floor() ???? ???? ??????? ??? ???? VBA Int(). ??????? ?????SQL Server ? Excel ??? ???? ??????? Ceiling() ????? ????? ????? ??? ????? (????? ????) ??? ?????? ????.?? ??? Visual Basic for Applications ???? ????? ?????? ???????. ??? ???? ??????? ??????? ?? Fix() ? Int() ???? ??????? ?????? ??? ???? ? ???? ??????. ????? Fix() ?????? 0 (???? ?? ??????? ?????? ???? ????? ?? ??? ????? ???????). ?? Fix(-3.5)-3.5. ????? Int() ?????? ?? 0 (???? ?? ??? ????? ??????? ???? ????? ?? ??????? ????). ?? Int(-3.5)-4. ????? ???????????? ????? ????? ?? ????? ????? ?????? ?? ??? ???????? ?????? ??? ????? ??????. ??? ???? ??????? ??? ??? ?????? 1.9 ??? 1 ????? ???? ?????? ?? ??? ??? ?????? ???? ??? ??? 2. ?? ????? ?????? ??? ?? ??? ????? ??????? ?? 1-6 ??? 2.4 ??? 2.????, ???? ????? 1.5 ??? equidistant ??? 1 ? 2 ? ?????? ?????? ? ??? ????? ????? ????? ??? ?????. ????? ????? ??????? ????? ??? ??????? ???? ?????? ???? ?????-.5 "-1 ?? ?? ????? ??? ??????? ? ??? ??? ?????-.5 ??? 0. ???? ??????? ??????? ??????? ????? ????????: ???? ???? ???????? Round() Excel. ???? ????? ???? SQL Server Round() ??????? ????? ????????. ???? ?????? ??????? ??????? ??? ?????? ?????: ????? Round() ????? ??????? Java. ?? ??? ?? ???? ??? ??????? ????? Visual Basic for Applications. ????? ????? banker??? ????? ??? ?????? ??????? ????, ????? ?????.5 ?? ??? ??????? ??????? ?? ???????? ????? ?? ??????? ?? ????? ????. ??? ????? ???? ?? ???????? ???????? ??????? ?????? banker.????? ??????? ?????? banker.5 ????? ??????? "?" ????? ?????? ?? ??? ???????. ?????? ?????? ??? ???? ??? ???? ???? ?? 1.5 ? 2.5 ?????? ??? 2? ? 3.5 4.5 ?????? ?????? ??? 4. ??????? ?????? banker ????????. ?? Visual Basic for Applications ??????? ??????? ??????? ?????? ??????? ?????? banker: CByte() ? CInt() CLng() CCur() ? Round(). ?? ???? ??? ????? ???? ?????? Excel ????? ??????? ?????? banker. ????? ????????????? banker ??? ???? ????? ??????????. ????? ??? ???? ?????? ????? ???????? ???? ?????.5 ????? ?? ????? ???? ?????? ???? ????. ???? ??????? ??? ??? ?? ????? ???????? ?? ??? ? ???????? ?? ???? ??????. ??? ???? ?? ???? ??????? ??????? ?????? ?? ?????? ????? ???? ?????? ?? ???????? ???? ?? ??????? ?????? banker. ?? ???? ?? ??????? ?????? ??? ???????? ?????? ??? ??? ????????.????? ?????? Microsoft ?? ???? ?? ????? ?? ??????? ??????? ??????. ?????? ?????????? ??? 0.5 ????? ? ????? 0.5 ??????? ??????? ?????? ??? ????????? ?????????.????? ?? ?????? Microsoft ????? ??????? ????. ?? ???? Round() Inconsistently ??? ????????? ??? ????? ?????? Round() ?????? ??????? ??? ?????? Microsoft ?????? ?????? ?????????.????? ?????? ?????? ?????? ???????:
Product Implementation
----------------------------------------------------------------------
Visual Basic for Applications 6.0 Banker's Rounding
Excel Worksheet Symmetric Arithmetic Rounding
SQL Server Either Symmetric Arithmetic Rounding
or Symmetric Round Down (Fix)
depending on arguments
Java Math library Asymmetric Arithmetic Rounding
????? ???? Round() ?? Visual Basic 6.0 ? Visual Basic for Applications 6.0 ??????? ?????? banker. ????? ??? ????? ????? ??????? ???? ???? ??? ??????? ??????? ?????? ???: ????? ???????????? ?????? ?????? ??? ???????? ????????? ???????? ???????? ???????? ??????? ??? ????? ??????????? ???? ?? ???????.
Number/Int./Fix/Ceiling/Asym. Arith./Sym. Arith./Banker's/Random/Alt.
---------------------------------------------------------------------
-2.6 -3 -2 -2 -3 -3 -3 -3 -3
-2.5 -3 -2 -2 -2 -3 -2 -2 -3
-2.4 -3 -2 -2 -2 -2 -2 -2 -2
-1.6 -2 -1 -1 -2 -2 -2 -2 -2
-1.5 -2 -1 -1 -1 -2 -2 -1 -1
-1.4 -2 -1 -1 -1 -1 -1 -1 -1
-0.6 -1 0 0 -1 -1 -1 -1 -1
-0.5 -1 0 0 0 -1 0 -1 -1
-0.4 -1 0 0 0 0 0 0 0
0.4 0 0 1 0 0 0 0 0
0.5 0 0 1 1 1 0 1 1
0.6 0 0 1 1 1 1 1 1
1.4 1 1 2 1 1 1 1 1
1.5 1 1 2 2 2 2 1 1
1.6 1 1 2 2 2 2 2 2
2.4 2 2 3 2 2 2 2 2
2.5 2 2 3 3 3 2 3 3
2.6 2 2 3 3 3 3 3 3
?????? ???? ???????: Number/Int./Fix/Ceiling/Asym. Arith./Sym. Arith./Banker's/Random/Alt. --------------------------------------------------------------------- 0.0 -9 0 9 3 0 0 1 0 ?????? ???? ??????? ???????: Number/Int./Fix/Ceiling/Asym. Arith./Sym. Arith./Banker's/Random/Alt. --------------------------------------------------------------------- -13.5 -18 -9 -9 -12 -15 -13 -13 -14 ?????? ???? ??????? ???????: Number/Int./Fix/Ceiling/Asym. Arith./Sym. Arith./Banker's/Random/Alt. --------------------------------------------------------------------- 13.5 9 9 18 15 15 13 14 14 ???? ?????? ????? ??? ???????? ??????? ????????. ????? ??????? ???????? ????? ???? ??????, Fix() ??????? ????? ???????? ? ??????? ?????? banker ? ??????? ?? ????? ??????? ???? ????? ??? ?? ???????? ??????? ?? ??????? ?????? ?? ???? ???. ??? ???? ??? ???? ??????? ??? ???? ???? ????? ?? ????? banker ????? ??????? ????????? ??????? ? ??????? ?????? ???? ????? ??? ?? ???????? ??????. ????? ???? ?? ??? ???????? ??????? ???????????? ???????? ???????? ?? ?????? "????? ???????" ??????? ???? ??????? ?????? ??? ?? ????? ??????? ????.??????? ????????:
AsymDown Asymmetrically rounds numbers down - similar to Int().
Negative numbers get more negative.
SymDown Symmetrically rounds numbers down - similar to Fix().
Truncates all numbers toward 0.
Same as AsymDown for positive numbers.
AsymUp Asymmetrically rounds numbers fractions up.
Same as SymDown for negative numbers.
Similar to Ceiling.
SymUp Symmetrically rounds fractions up - that is, away from 0.
Same as AsymUp for positive numbers.
Same as AsymDown for negative numbers.
AsymArith Asymmetric arithmetic rounding - rounds .5 up always.
Similar to Java worksheet Round function.
SymArith Symmetric arithmetic rounding - rounds .5 away from 0.
Same as AsymArith for positive numbers.
Similar to Excel Worksheet Round function.
BRound Banker's rounding.
Rounds .5 up or down to achieve an even number.
Symmetrical by definition.
RandRound Random rounding.
Rounds .5 up or down in a random fashion.
AltRound Alternating rounding.
Alternates between rounding .5 up or down.
ATruncDigits Same as AsyncTrunc but takes different arguments.
???? ??? ??????? ?????? ?????????: ??? ???? ?????? ? ???? ???????. ?? ???? ??? factor? ??????? ?????? ??? ???? ?????? ?????? ???? ????? ???????? ?????. ??? ?? ????? ???? ?? ????? ????? ?????? ?????? ?????? ??????? ?????? ???????. ??? ???? ?????? ???? AsymArith (2.55, 10) 2.6 ? ?????? ????? ??? 1/???? = 1/10 = 0.1. ??????: ???? 0 ?????? ??? ??? ???????: 1/???? = 1/0. ???? ?????? ?????? ????????? ????? ??????: Expression Result Comment -------------------------------------------------------------------- AsymArith(2.5) 3 Rounds up to next integer. BRound(2.18, 20) 2.2 Rounds to the nearest 5 cents (1/20 dollar). SymDown(25, .1) 20 Rounds down to an even multiple of 10. ????????? ??? ????? ????? ?? ADownDigits ???? ???? ???? ?? ?????? ??? ??????? ??????? ????? ?? ????. Expression Result Comment --------------------------------------------------------------------- ADownDigits(2.18, 1) 2.1 Rounds down to next multiple of 10 ^ -1. ??? ????????????: ?? ???? ??????? ?? Excel MRound() ???? ???? ?????, ?????? ???? - ?? ??????? ????? ?????? ???????? ?????? ADownDigits ??? ??????? ??????? ???? ?????? ??? ??????? ????? ?? ????. ??????? ??????? ??????? ????? ??? ???? ??? MRound() ? ??? ???? ????? ???? ??? ???? ?????? ??? ????? ?? 10. ????? ????? ?????? ????? ????? ?????? ADownDigits. ???? ?????? ????? ?????????? ???? ??????? ??????? ????? ??? ??? ?????? ????? ????? ????? ????? ??????? ??????? 15 ???????.??? ???? ??????? ?? ????? ???? ???? ???? ??????, ?? ????? ?????? ??? ????? ??? ?????? ??? ???? ????? ?? ?????? ?? ?????? ???????. ??? ???? ??????? ??? 2.25 ???? ???? ?? ?? ??????? ??????? ??... ? 2.2499999 ???? ?? ?????? ?? ??????? ????? ????? ?? ????? ??? ?? ?????. ?????? ?? ???????? ??? ??? ??? ???? ???? ???????? ?? ??? deviate ?????? ???????? ??????? ?? ?????? ??????? ?????. ??? ???? ??? ?? ?????? ?? ????? ??? ?????? ??? ?????? ?????? ??? ?????? ??? ?????? ??? 4 ?? ??????? ???????. ????? ????? ????? ????? ???????? Variant ???????? CDec() ?????? ?? ??? ??? ??? ?????? ???? ????? ???? ?? ???? ????? ??? ??????? ??????? 28. ??? ???? ?????????? ??????? ??? ???????? ?????? ??? ?????? 4 ????? ????? ????? ???? ?????? ??? ??????? ??????? 2 ?? cents.?? ?????? Round2CB ???? ????? ??????? ????? ?????? ???? ???? ??????? ?????? banker ??? ??????? ??????? 2 ???? ?? ??? ??? ??????. ???? ??? ??? ????? ??? ?????? ??? ????? ????? ????? ???? ??? ???????? ??????. ??????? ??? ??????????? ???? ??? ?????? ????? ??????? ???????? ??? ???????? ????:????? ????? ??????? ?? ?????????? taught ?? ??????? ? ??????? ????? ?? ????? ??????? ???????? ????? ?????. ?? ??? ????? ?? ??????? ????? ??? ??? ????? ????? ??? 1 ??? ??????? ??? ??? ?????? ???. ????? ??????? ??? ????? ????? ?????. ????? ???? ??? ????? ????? ??????? ??????? ??????.??? ???? ??????? ?? 2.5 ? 2.51 ????????? ??? ??? 3 ????? ?? 2.4 ? 2.49 ?????? ??? 2. ??? ??????? ??????? ?????? banker (?? ?????? ???? ?????.5 ???? ?? ????) ?? ??? ????? ??????? ??????? ???????? ??????? ??? ?????? ????? ?????? ????? ?? ???? ??? ????? ??? ????? ??? ??? ?? ????????? ???? ?? ???? ???. ??? ???? ??????? ?? ??????? ?????? banker 2.5 ????? ??? ????? 2 ? 2.51 ??? ??? 3. ?? ??????? ?????? ??? ?????? ????? 2.5 2 ??? ????? ?????-2.51 ??? 3. ??? ??????? ??????? ?? ??? ???????? ?? ??? ??????? ??? ???? ????? ??????? ?? ???????? ??? ????? ???????. ???????????? Visual Basic ??????? 6.0; ???????: Int ? ????? ?????; ???? ?????? Transact SQL ??????? Microsoft; ???????: ???? Round; ???? ?????; ???? ??? (?) 1998 ???? Microsoft ? ???? ???? ?????. ????????? ?????? Malcolm Stewart ? Microsoft Corporation. ??????????? ???????: 196652 - ????? ??? ??????: 27/????? ??????/1425 - ??????: 3.2 ????? ???
????? ???? ???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ?????? ???? ??? ????? ??????? ?????? ??????????196652
(http://support.microsoft.com/kb/196652/en-us/
)
|




???? ??? ??????








