diff options
Diffstat (limited to 'Lib/test/decimaltestdata/tointegral.decTest')
-rw-r--r-- | Lib/test/decimaltestdata/tointegral.decTest | 69 |
1 files changed, 67 insertions, 2 deletions
diff --git a/Lib/test/decimaltestdata/tointegral.decTest b/Lib/test/decimaltestdata/tointegral.decTest index f7174d4..ad25e6b 100644 --- a/Lib/test/decimaltestdata/tointegral.decTest +++ b/Lib/test/decimaltestdata/tointegral.decTest @@ -1,6 +1,6 @@ ------------------------------------------------------------------------ -- tointegral.decTest -- round decimal to integral value -- --- Copyright (c) IBM Corporation, 2001, 2003. All rights reserved. -- +-- Copyright (c) IBM Corporation, 2001, 2007. All rights reserved. -- ------------------------------------------------------------------------ -- Please see the document "General Decimal Arithmetic Testcases" -- -- at http://www2.hursley.ibm.com/decimal for the description of -- @@ -17,7 +17,7 @@ -- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ -version: 2.39 +version: 2.56 -- This set of tests tests the extended specification 'round-to-integral -- value' operation (from IEEE 854, later modified in 754r). @@ -174,3 +174,68 @@ intx205 tointegral 10E+5 -> 1.0E+6 intx206 tointegral 7.89E+77 -> 7.89E+77 intx207 tointegral -Inf -> -Infinity + +-- all rounding modes +rounding: half_even + +intx210 tointegral 55.5 -> 56 +intx211 tointegral 56.5 -> 56 +intx212 tointegral 57.5 -> 58 +intx213 tointegral -55.5 -> -56 +intx214 tointegral -56.5 -> -56 +intx215 tointegral -57.5 -> -58 + +rounding: half_up + +intx220 tointegral 55.5 -> 56 +intx221 tointegral 56.5 -> 57 +intx222 tointegral 57.5 -> 58 +intx223 tointegral -55.5 -> -56 +intx224 tointegral -56.5 -> -57 +intx225 tointegral -57.5 -> -58 + +rounding: half_down + +intx230 tointegral 55.5 -> 55 +intx231 tointegral 56.5 -> 56 +intx232 tointegral 57.5 -> 57 +intx233 tointegral -55.5 -> -55 +intx234 tointegral -56.5 -> -56 +intx235 tointegral -57.5 -> -57 + +rounding: up + +intx240 tointegral 55.3 -> 56 +intx241 tointegral 56.3 -> 57 +intx242 tointegral 57.3 -> 58 +intx243 tointegral -55.3 -> -56 +intx244 tointegral -56.3 -> -57 +intx245 tointegral -57.3 -> -58 + +rounding: down + +intx250 tointegral 55.7 -> 55 +intx251 tointegral 56.7 -> 56 +intx252 tointegral 57.7 -> 57 +intx253 tointegral -55.7 -> -55 +intx254 tointegral -56.7 -> -56 +intx255 tointegral -57.7 -> -57 + +rounding: ceiling + +intx260 tointegral 55.3 -> 56 +intx261 tointegral 56.3 -> 57 +intx262 tointegral 57.3 -> 58 +intx263 tointegral -55.3 -> -55 +intx264 tointegral -56.3 -> -56 +intx265 tointegral -57.3 -> -57 + +rounding: floor + +intx270 tointegral 55.7 -> 55 +intx271 tointegral 56.7 -> 56 +intx272 tointegral 57.7 -> 57 +intx273 tointegral -55.7 -> -56 +intx274 tointegral -56.7 -> -57 +intx275 tointegral -57.7 -> -58 + |