We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0407b3a commit 205e8f9Copy full SHA for 205e8f9
lib/aiken/math/rational.ak
@@ -406,10 +406,18 @@ pub fn round(self: Rational) -> Int {
406
407
when compare(abs(f), ratio(1, 2)) is {
408
Less -> n
409
- Equal if is_negative -> n
410
- Equal -> n + 1
411
- Greater if is_negative -> n - 1
412
- Greater -> n + 1
+ Equal ->
+ if is_negative {
+ n
+ } else {
413
+ n + 1
414
+ }
415
+ Greater ->
416
417
+ n - 1
418
419
420
421
}
422
423
@@ -456,8 +464,12 @@ pub fn round_even(self: Rational) -> Int {
456
464
457
465
458
466
459
- Equal if is_even -> n
460
- Equal -> n + m
467
468
+ if is_even {
469
470
471
+ n + m
472
461
473
Greater -> n + m
462
474
463
475
0 commit comments