| 1 | # from the article text |
|---|
| 2 | # http://www.pldesignline.com/howto/showArticle.jhtml?articleID=175801189 |
|---|
| 3 | is(round_half_up_symmetric(3.5), 4); |
|---|
| 4 | is(round_half_up_symmetric(-3.5), -4); |
|---|
| 5 | is(round_half_up_asymmetric(3.5), 4); |
|---|
| 6 | is(round_half_up_asymmetric(-3.5), -3); |
|---|
| 7 | |
|---|
| 8 | is(round_half_down_symmetric(3.5), 3); |
|---|
| 9 | is(round_half_down_symmetric(-3.5), -3); |
|---|
| 10 | is(round_half_down_asymmetric(3.5), 3); |
|---|
| 11 | is(round_half_down_asymmetric(-3.5), -4); |
|---|
| 12 | |
|---|
| 13 | is(round_half_even(3.5), 4); |
|---|
| 14 | is(round_half_even(4.5), 4); |
|---|
| 15 | is(round_half_even(-3.5), -4); |
|---|
| 16 | is(round_half_even(-4.5), -4); |
|---|
| 17 | |
|---|
| 18 | is(round_half_odd(3.5), 3); |
|---|
| 19 | is(round_half_odd(4.5), 5); |
|---|
| 20 | is(round_half_odd(-3.5), -3); |
|---|
| 21 | is(round_half_odd(-4.5), -5); |
|---|
| 22 | |
|---|
| 23 | is(round_alternate(3.5), 4, 'alternate: first round up'); |
|---|
| 24 | is(round_alternate(3.5), 3, 'alternate: then round down'); |
|---|
| 25 | is(round_alternate(3.5), 4, 'alternate: then round up'); |
|---|
| 26 | is(round_alternate(3.5), 3, 'alternate: then round down'); |
|---|
| 27 | is(round_alternate(3.5), 4, 'alternate: then round up'); |
|---|
| 28 | is(round_alternate(3.5), 3, 'alternate: then round down'); |
|---|
| 29 | |
|---|
| 30 | # FIXME |
|---|
| 31 | # how do I reset the state $round_up variable? |
|---|
| 32 | # is(round_alternate(-3.5), -4, 'alternate with neg: first round up'); |
|---|
| 33 | # is(round_alternate(-3.5), -3, 'alternate with neg: then round down'); |
|---|
| 34 | # is(round_alternate(-3.5), -4, 'alternate with neg: then round up'); |
|---|
| 35 | # is(round_alternate(-3.5), -3, 'alternate with neg: then round down'); |
|---|
| 36 | # is(round_alternate(-3.5), -4, 'alternate with neg: then round up'); |
|---|
| 37 | # is(round_alternate(-3.5), -3, 'alternate with neg: then round down'); |
|---|
| 38 | |
|---|
| 39 | is(round_random(3.5), any(3,4)); |
|---|
| 40 | is(round_random(4.5), any(4,5)); |
|---|
| 41 | is(round_random(5.5), any(5,6)); |
|---|
| 42 | is(round_random(6.5), any(6,7)); |
|---|
| 43 | is(round_random(7.5), any(7,8)); |
|---|
| 44 | is(round_random(8.5), any(8,9)); |
|---|
| 45 | |
|---|
| 46 | is(round_ceiling(3.0), 3); |
|---|
| 47 | is(round_ceiling(3.1), 4); |
|---|
| 48 | is(round_ceiling(3.2), 4); |
|---|
| 49 | is(round_ceiling(3.3), 4); |
|---|
| 50 | is(round_ceiling(3.4), 4); |
|---|
| 51 | is(round_ceiling(3.5), 4); |
|---|
| 52 | is(round_ceiling(3.6), 4); |
|---|
| 53 | is(round_ceiling(3.7), 4); |
|---|
| 54 | is(round_ceiling(3.8), 4); |
|---|
| 55 | is(round_ceiling(3.9), 4); |
|---|
| 56 | is(round_ceiling(-3.0), -3); |
|---|
| 57 | is(round_ceiling(-3.1), -3); |
|---|
| 58 | is(round_ceiling(-3.2), -3); |
|---|
| 59 | is(round_ceiling(-3.3), -3); |
|---|
| 60 | is(round_ceiling(-3.4), -3); |
|---|
| 61 | is(round_ceiling(-3.5), -3); |
|---|
| 62 | is(round_ceiling(-3.6), -3); |
|---|
| 63 | is(round_ceiling(-3.7), -3); |
|---|
| 64 | is(round_ceiling(-3.8), -3); |
|---|
| 65 | is(round_ceiling(-3.9), -3); |
|---|
| 66 | |
|---|
| 67 | is(round_floor(-3.0), -3); |
|---|
| 68 | is(round_floor(-3.1), -4); |
|---|
| 69 | is(round_floor(-3.2), -4); |
|---|
| 70 | is(round_floor(-3.3), -4); |
|---|
| 71 | is(round_floor(-3.4), -4); |
|---|
| 72 | is(round_floor(-3.5), -4); |
|---|
| 73 | is(round_floor(-3.6), -4); |
|---|
| 74 | is(round_floor(-3.7), -4); |
|---|
| 75 | is(round_floor(-3.8), -4); |
|---|
| 76 | is(round_floor(-3.9), -4); |
|---|
| 77 | is(round_floor(3.0), 3); |
|---|
| 78 | is(round_floor(3.1), 3); |
|---|
| 79 | is(round_floor(3.2), 3); |
|---|
| 80 | is(round_floor(3.3), 3); |
|---|
| 81 | is(round_floor(3.4), 3); |
|---|
| 82 | is(round_floor(3.5), 3); |
|---|
| 83 | is(round_floor(3.6), 3); |
|---|
| 84 | is(round_floor(3.7), 3); |
|---|
| 85 | is(round_floor(3.8), 3); |
|---|
| 86 | is(round_floor(3.9), 3); |
|---|
| 87 | |
|---|
| 88 | is(round_toward_zero(3.1), 3); |
|---|
| 89 | is(round_toward_zero(3.2), 3); |
|---|
| 90 | is(round_toward_zero(3.3), 3); |
|---|
| 91 | is(round_toward_zero(3.4), 3); |
|---|
| 92 | is(round_toward_zero(3.5), 3); |
|---|
| 93 | is(round_toward_zero(3.6), 3); |
|---|
| 94 | is(round_toward_zero(3.7), 3); |
|---|
| 95 | is(round_toward_zero(3.8), 3); |
|---|
| 96 | is(round_toward_zero(3.9), 3); |
|---|
| 97 | is(round_toward_zero(-3.1), -3); |
|---|
| 98 | is(round_toward_zero(-3.2), -3); |
|---|
| 99 | is(round_toward_zero(-3.3), -3); |
|---|
| 100 | is(round_toward_zero(-3.4), -3); |
|---|
| 101 | is(round_toward_zero(-3.5), -3); |
|---|
| 102 | is(round_toward_zero(-3.6), -3); |
|---|
| 103 | is(round_toward_zero(-3.7), -3); |
|---|
| 104 | is(round_toward_zero(-3.8), -3); |
|---|
| 105 | is(round_toward_zero(-3.9), -3); |
|---|
| 106 | |
|---|
| 107 | is(round_away_from_zero(3.1), 4); |
|---|
| 108 | is(round_away_from_zero(3.2), 4); |
|---|
| 109 | is(round_away_from_zero(3.3), 4); |
|---|
| 110 | is(round_away_from_zero(3.4), 4); |
|---|
| 111 | is(round_away_from_zero(3.5), 4); |
|---|
| 112 | is(round_away_from_zero(3.6), 4); |
|---|
| 113 | is(round_away_from_zero(3.7), 4); |
|---|
| 114 | is(round_away_from_zero(3.8), 4); |
|---|
| 115 | is(round_away_from_zero(3.9), 4); |
|---|
| 116 | is(round_away_from_zero(-3.1), -4); |
|---|
| 117 | is(round_away_from_zero(-3.2), -4); |
|---|
| 118 | is(round_away_from_zero(-3.3), -4); |
|---|
| 119 | is(round_away_from_zero(-3.4), -4); |
|---|
| 120 | is(round_away_from_zero(-3.5), -4); |
|---|
| 121 | is(round_away_from_zero(-3.6), -4); |
|---|
| 122 | is(round_away_from_zero(-3.7), -4); |
|---|
| 123 | is(round_away_from_zero(-3.8), -4); |
|---|
| 124 | is(round_away_from_zero(-3.9), -4); |
|---|
| 125 | |
|---|
| 126 | is(sign(3.0), 1); |
|---|
| 127 | is(sign(0.0), 0); |
|---|
| 128 | is(sign(-3.0), -1); |
|---|
| 129 | |
|---|
| 130 | # from the table |
|---|
| 131 | # http://i.cmpnet.com/pldesignline/2006/01/max-round-tab01.gif |
|---|
| 132 | |
|---|
| 133 | is(round_half_up_symmetric(3.0), +3); |
|---|
| 134 | is(round_half_up_symmetric(3.1), +3); |
|---|
| 135 | is(round_half_up_symmetric(3.4), +3); |
|---|
| 136 | is(round_half_up_symmetric(3.5), +4); |
|---|
| 137 | is(round_half_up_symmetric(3.6), +4); |
|---|
| 138 | is(round_half_up_symmetric(3.9), +4); |
|---|
| 139 | is(round_half_up_symmetric(4.0), +4); |
|---|
| 140 | is(round_half_up_symmetric(4.1), +4); |
|---|
| 141 | is(round_half_up_symmetric(4.4), +4); |
|---|
| 142 | is(round_half_up_symmetric(4.5), +5); |
|---|
| 143 | is(round_half_up_symmetric(4.6), +5); |
|---|
| 144 | is(round_half_up_symmetric(4.9), +5); |
|---|
| 145 | is(round_half_up_symmetric(5.0), +5); |
|---|
| 146 | is(round_half_up_symmetric(-3.0), -3); |
|---|
| 147 | is(round_half_up_symmetric(-3.1), -3); |
|---|
| 148 | is(round_half_up_symmetric(-3.4), -3); |
|---|
| 149 | is(round_half_up_symmetric(-3.5), -4); |
|---|
| 150 | is(round_half_up_symmetric(-3.6), -4); |
|---|
| 151 | is(round_half_up_symmetric(-3.9), -4); |
|---|
| 152 | is(round_half_up_symmetric(-4.0), -4); |
|---|
| 153 | is(round_half_up_symmetric(-4.1), -4); |
|---|
| 154 | is(round_half_up_symmetric(-4.4), -4); |
|---|
| 155 | is(round_half_up_symmetric(-4.5), -5); |
|---|
| 156 | is(round_half_up_symmetric(-4.6), -5); |
|---|
| 157 | is(round_half_up_symmetric(-4.9), -5); |
|---|
| 158 | is(round_half_up_symmetric(-5.0), -5); |
|---|
| 159 | |
|---|
| 160 | is(round_half_up_asymmetric(3.0), +3); |
|---|
| 161 | is(round_half_up_asymmetric(3.1), +3); |
|---|
| 162 | is(round_half_up_asymmetric(3.4), +3); |
|---|
| 163 | is(round_half_up_asymmetric(3.5), +4); |
|---|
| 164 | is(round_half_up_asymmetric(3.6), +4); |
|---|
| 165 | is(round_half_up_asymmetric(3.9), +4); |
|---|
| 166 | is(round_half_up_asymmetric(4.0), +4); |
|---|
| 167 | is(round_half_up_asymmetric(4.1), +4); |
|---|
| 168 | is(round_half_up_asymmetric(4.4), +4); |
|---|
| 169 | is(round_half_up_asymmetric(4.5), +5); |
|---|
| 170 | is(round_half_up_asymmetric(4.6), +5); |
|---|
| 171 | is(round_half_up_asymmetric(4.9), +5); |
|---|
| 172 | is(round_half_up_asymmetric(5.0), +5); |
|---|
| 173 | is(round_half_up_asymmetric(-3.0), -3); |
|---|
| 174 | is(round_half_up_asymmetric(-3.1), -3); |
|---|
| 175 | is(round_half_up_asymmetric(-3.4), -3); |
|---|
| 176 | is(round_half_up_asymmetric(-3.5), -3); |
|---|
| 177 | is(round_half_up_asymmetric(-3.6), -4); |
|---|
| 178 | is(round_half_up_asymmetric(-3.9), -4); |
|---|
| 179 | is(round_half_up_asymmetric(-4.0), -4); |
|---|
| 180 | is(round_half_up_asymmetric(-4.1), -4); |
|---|
| 181 | is(round_half_up_asymmetric(-4.4), -4); |
|---|
| 182 | is(round_half_up_asymmetric(-4.5), -4); |
|---|
| 183 | is(round_half_up_asymmetric(-4.6), -5); |
|---|
| 184 | is(round_half_up_asymmetric(-4.9), -5); |
|---|
| 185 | is(round_half_up_asymmetric(-5.0), -5); |
|---|
| 186 | |
|---|
| 187 | is(round_half_down_symmetric(3.0), +3); |
|---|
| 188 | is(round_half_down_symmetric(3.1), +3); |
|---|
| 189 | is(round_half_down_symmetric(3.4), +3); |
|---|
| 190 | is(round_half_down_symmetric(3.5), +3); |
|---|
| 191 | is(round_half_down_symmetric(3.6), +4); |
|---|
| 192 | is(round_half_down_symmetric(3.9), +4); |
|---|
| 193 | is(round_half_down_symmetric(4.0), +4); |
|---|
| 194 | is(round_half_down_symmetric(4.1), +4); |
|---|
| 195 | is(round_half_down_symmetric(4.4), +4); |
|---|
| 196 | is(round_half_down_symmetric(4.5), +4); |
|---|
| 197 | is(round_half_down_symmetric(4.6), +5); |
|---|
| 198 | is(round_half_down_symmetric(4.9), +5); |
|---|
| 199 | is(round_half_down_symmetric(5.0), +5); |
|---|
| 200 | is(round_half_down_symmetric(-3.0), -3); |
|---|
| 201 | is(round_half_down_symmetric(-3.1), -3); |
|---|
| 202 | is(round_half_down_symmetric(-3.4), -3); |
|---|
| 203 | is(round_half_down_symmetric(-3.5), -3); |
|---|
| 204 | is(round_half_down_symmetric(-3.6), -4); |
|---|
| 205 | is(round_half_down_symmetric(-3.9), -4); |
|---|
| 206 | is(round_half_down_symmetric(-4.0), -4); |
|---|
| 207 | is(round_half_down_symmetric(-4.1), -4); |
|---|
| 208 | is(round_half_down_symmetric(-4.4), -4); |
|---|
| 209 | is(round_half_down_symmetric(-4.5), -4); |
|---|
| 210 | is(round_half_down_symmetric(-4.6), -5); |
|---|
| 211 | is(round_half_down_symmetric(-4.9), -5); |
|---|
| 212 | is(round_half_down_symmetric(-5.0), -5); |
|---|
| 213 | |
|---|
| 214 | is(round_half_down_asymmetric(3.0), +3); |
|---|
| 215 | is(round_half_down_asymmetric(3.1), +3); |
|---|
| 216 | is(round_half_down_asymmetric(3.4), +3); |
|---|
| 217 | is(round_half_down_asymmetric(3.5), +3); |
|---|
| 218 | is(round_half_down_asymmetric(3.6), +4); |
|---|
| 219 | is(round_half_down_asymmetric(3.9), +4); |
|---|
| 220 | is(round_half_down_asymmetric(4.0), +4); |
|---|
| 221 | is(round_half_down_asymmetric(4.1), +4); |
|---|
| 222 | is(round_half_down_asymmetric(4.4), +4); |
|---|
| 223 | is(round_half_down_asymmetric(4.5), +4); |
|---|
| 224 | is(round_half_down_asymmetric(4.6), +5); |
|---|
| 225 | is(round_half_down_asymmetric(4.9), +5); |
|---|
| 226 | is(round_half_down_asymmetric(5.0), +5); |
|---|
| 227 | is(round_half_down_asymmetric(-3.0), -3); |
|---|
| 228 | is(round_half_down_asymmetric(-3.1), -3); |
|---|
| 229 | is(round_half_down_asymmetric(-3.4), -3); |
|---|
| 230 | is(round_half_down_asymmetric(-3.5), -4); |
|---|
| 231 | is(round_half_down_asymmetric(-3.6), -4); |
|---|
| 232 | is(round_half_down_asymmetric(-3.9), -4); |
|---|
| 233 | is(round_half_down_asymmetric(-4.0), -4); |
|---|
| 234 | is(round_half_down_asymmetric(-4.1), -4); |
|---|
| 235 | is(round_half_down_asymmetric(-4.4), -4); |
|---|
| 236 | is(round_half_down_asymmetric(-4.5), -5); |
|---|
| 237 | is(round_half_down_asymmetric(-4.6), -5); |
|---|
| 238 | is(round_half_down_asymmetric(-4.9), -5); |
|---|
| 239 | is(round_half_down_asymmetric(-5.0), -5); |
|---|
| 240 | |
|---|
| 241 | is(round_half_even(3.0), +3); |
|---|
| 242 | is(round_half_even(3.1), +3); |
|---|
| 243 | is(round_half_even(3.4), +3); |
|---|
| 244 | is(round_half_even(3.5), +4); |
|---|
| 245 | is(round_half_even(3.6), +4); |
|---|
| 246 | is(round_half_even(3.9), +4); |
|---|
| 247 | is(round_half_even(4.0), +4); |
|---|
| 248 | is(round_half_even(4.1), +4); |
|---|
| 249 | is(round_half_even(4.4), +4); |
|---|
| 250 | is(round_half_even(4.5), +4); |
|---|
| 251 | is(round_half_even(4.6), +5); |
|---|
| 252 | is(round_half_even(4.9), +5); |
|---|
| 253 | is(round_half_even(5.0), +5); |
|---|
| 254 | is(round_half_even(-3.0), -3); |
|---|
| 255 | is(round_half_even(-3.1), -3); |
|---|
| 256 | is(round_half_even(-3.4), -3); |
|---|
| 257 | is(round_half_even(-3.5), -4); |
|---|
| 258 | is(round_half_even(-3.6), -4); |
|---|
| 259 | is(round_half_even(-3.9), -4); |
|---|
| 260 | is(round_half_even(-4.0), -4); |
|---|
| 261 | is(round_half_even(-4.1), -4); |
|---|
| 262 | is(round_half_even(-4.4), -4); |
|---|
| 263 | is(round_half_even(-4.5), -4); |
|---|
| 264 | is(round_half_even(-4.6), -5); |
|---|
| 265 | is(round_half_even(-4.9), -5); |
|---|
| 266 | is(round_half_even(-5.0), -5); |
|---|
| 267 | |
|---|
| 268 | is(round_half_odd(3.0), +3); |
|---|
| 269 | is(round_half_odd(3.1), +3); |
|---|
| 270 | is(round_half_odd(3.4), +3); |
|---|
| 271 | is(round_half_odd(3.5), +3); |
|---|
| 272 | is(round_half_odd(3.6), +4); |
|---|
| 273 | is(round_half_odd(3.9), +4); |
|---|
| 274 | is(round_half_odd(4.0), +4); |
|---|
| 275 | is(round_half_odd(4.1), +4); |
|---|
| 276 | is(round_half_odd(4.4), +4); |
|---|
| 277 | is(round_half_odd(4.5), +5); |
|---|
| 278 | is(round_half_odd(4.6), +5); |
|---|
| 279 | is(round_half_odd(4.9), +5); |
|---|
| 280 | is(round_half_odd(5.0), +5); |
|---|
| 281 | is(round_half_odd(-3.0), -3); |
|---|
| 282 | is(round_half_odd(-3.1), -3); |
|---|
| 283 | is(round_half_odd(-3.4), -3); |
|---|
| 284 | is(round_half_odd(-3.5), -3); |
|---|
| 285 | is(round_half_odd(-3.6), -4); |
|---|
| 286 | is(round_half_odd(-3.9), -4); |
|---|
| 287 | is(round_half_odd(-4.0), -4); |
|---|
| 288 | is(round_half_odd(-4.1), -4); |
|---|
| 289 | is(round_half_odd(-4.4), -4); |
|---|
| 290 | is(round_half_odd(-4.5), -5); |
|---|
| 291 | is(round_half_odd(-4.6), -5); |
|---|
| 292 | is(round_half_odd(-4.9), -5); |
|---|
| 293 | is(round_half_odd(-5.0), -5); |
|---|
| 294 | |
|---|
| 295 | is(round_ceiling(3.0), +3); |
|---|
| 296 | is(round_ceiling(3.1), +4); |
|---|
| 297 | is(round_ceiling(3.4), +4); |
|---|
| 298 | is(round_ceiling(3.5), +4); |
|---|
| 299 | is(round_ceiling(3.6), +4); |
|---|
| 300 | is(round_ceiling(3.9), +4); |
|---|
| 301 | is(round_ceiling(4.0), +4); |
|---|
| 302 | is(round_ceiling(4.1), +5); |
|---|
| 303 | is(round_ceiling(4.4), +5); |
|---|
| 304 | is(round_ceiling(4.5), +5); |
|---|
| 305 | is(round_ceiling(4.6), +5); |
|---|
| 306 | is(round_ceiling(4.9), +5); |
|---|
| 307 | is(round_ceiling(5.0), +5); |
|---|
| 308 | is(round_ceiling(-3.0), -3); |
|---|
| 309 | is(round_ceiling(-3.1), -3); |
|---|
| 310 | is(round_ceiling(-3.4), -3); |
|---|
| 311 | is(round_ceiling(-3.5), -3); |
|---|
| 312 | is(round_ceiling(-3.6), -3); |
|---|
| 313 | is(round_ceiling(-3.9), -3); |
|---|
| 314 | is(round_ceiling(-4.0), -4); |
|---|
| 315 | is(round_ceiling(-4.1), -4); |
|---|
| 316 | is(round_ceiling(-4.4), -4); |
|---|
| 317 | is(round_ceiling(-4.5), -4); |
|---|
| 318 | is(round_ceiling(-4.6), -4); |
|---|
| 319 | is(round_ceiling(-4.9), -4); |
|---|
| 320 | is(round_ceiling(-5.0), -5); |
|---|
| 321 | |
|---|
| 322 | is(round_floor(3.0), +3); |
|---|
| 323 | is(round_floor(3.1), +3); |
|---|
| 324 | is(round_floor(3.4), +3); |
|---|
| 325 | is(round_floor(3.5), +3); |
|---|
| 326 | is(round_floor(3.6), +3); |
|---|
| 327 | is(round_floor(3.9), +3); |
|---|
| 328 | is(round_floor(4.0), +4); |
|---|
| 329 | is(round_floor(4.1), +4); |
|---|
| 330 | is(round_floor(4.4), +4); |
|---|
| 331 | is(round_floor(4.5), +4); |
|---|
| 332 | is(round_floor(4.6), +4); |
|---|
| 333 | is(round_floor(4.9), +4); |
|---|
| 334 | is(round_floor(5.0), +5); |
|---|
| 335 | is(round_floor(-3.0), -3); |
|---|
| 336 | is(round_floor(-3.1), -4); |
|---|
| 337 | is(round_floor(-3.4), -4); |
|---|
| 338 | is(round_floor(-3.5), -4); |
|---|
| 339 | is(round_floor(-3.6), -4); |
|---|
| 340 | is(round_floor(-3.9), -4); |
|---|
| 341 | is(round_floor(-4.0), -4); |
|---|
| 342 | is(round_floor(-4.1), -5); |
|---|
| 343 | is(round_floor(-4.4), -5); |
|---|
| 344 | is(round_floor(-4.5), -5); |
|---|
| 345 | is(round_floor(-4.6), -5); |
|---|
| 346 | is(round_floor(-4.9), -5); |
|---|
| 347 | is(round_floor(-5.0), -5); |
|---|
| 348 | |
|---|
| 349 | is(round_toward_zero(3.0), +3); |
|---|
| 350 | is(round_toward_zero(3.1), +3); |
|---|
| 351 | is(round_toward_zero(3.4), +3); |
|---|
| 352 | is(round_toward_zero(3.5), +3); |
|---|
| 353 | is(round_toward_zero(3.6), +3); |
|---|
| 354 | is(round_toward_zero(3.9), +3); |
|---|
| 355 | is(round_toward_zero(4.0), +4); |
|---|
| 356 | is(round_toward_zero(4.1), +4); |
|---|
| 357 | is(round_toward_zero(4.4), +4); |
|---|
| 358 | is(round_toward_zero(4.5), +4); |
|---|
| 359 | is(round_toward_zero(4.6), +4); |
|---|
| 360 | is(round_toward_zero(4.9), +4); |
|---|
| 361 | is(round_toward_zero(5.0), +5); |
|---|
| 362 | is(round_toward_zero(-3.0), -3); |
|---|
| 363 | is(round_toward_zero(-3.1), -3); |
|---|
| 364 | is(round_toward_zero(-3.4), -3); |
|---|
| 365 | is(round_toward_zero(-3.5), -3); |
|---|
| 366 | is(round_toward_zero(-3.6), -3); |
|---|
| 367 | is(round_toward_zero(-3.9), -3); |
|---|
| 368 | is(round_toward_zero(-4.0), -4); |
|---|
| 369 | is(round_toward_zero(-4.1), -4); |
|---|
| 370 | is(round_toward_zero(-4.4), -4); |
|---|
| 371 | is(round_toward_zero(-4.5), -4); |
|---|
| 372 | is(round_toward_zero(-4.6), -4); |
|---|
| 373 | is(round_toward_zero(-4.9), -4); |
|---|
| 374 | is(round_toward_zero(-5.0), -5); |
|---|
| 375 | |
|---|
| 376 | is(round_away_from_zero(3.0), +3); |
|---|
| 377 | is(round_away_from_zero(3.1), +4); |
|---|
| 378 | is(round_away_from_zero(3.4), +4); |
|---|
| 379 | is(round_away_from_zero(3.5), +4); |
|---|
| 380 | is(round_away_from_zero(3.6), +4); |
|---|
| 381 | is(round_away_from_zero(3.9), +4); |
|---|
| 382 | is(round_away_from_zero(4.0), +4); |
|---|
| 383 | is(round_away_from_zero(4.1), +5); |
|---|
| 384 | is(round_away_from_zero(4.4), +5); |
|---|
| 385 | is(round_away_from_zero(4.5), +5); |
|---|
| 386 | is(round_away_from_zero(4.6), +5); |
|---|
| 387 | is(round_away_from_zero(4.9), +5); |
|---|
| 388 | is(round_away_from_zero(5.0), +5); |
|---|
| 389 | is(round_away_from_zero(-3.0), -3); |
|---|
| 390 | is(round_away_from_zero(-3.1), -4); |
|---|
| 391 | is(round_away_from_zero(-3.4), -4); |
|---|
| 392 | is(round_away_from_zero(-3.5), -4); |
|---|
| 393 | is(round_away_from_zero(-3.6), -4); |
|---|
| 394 | is(round_away_from_zero(-3.9), -4); |
|---|
| 395 | is(round_away_from_zero(-4.0), -4); |
|---|
| 396 | is(round_away_from_zero(-4.1), -5); |
|---|
| 397 | is(round_away_from_zero(-4.4), -5); |
|---|
| 398 | is(round_away_from_zero(-4.5), -5); |
|---|
| 399 | is(round_away_from_zero(-4.6), -5); |
|---|
| 400 | is(round_away_from_zero(-4.9), -5); |
|---|
| 401 | is(round_away_from_zero(-5.0), -5); |
|---|