From 91b81730e4ff8bd4411b4367e172bd5164ef3ff0 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Wed, 14 Oct 2026 23:25:50 +0900 Subject: [PATCH] Add half: keyword to Numeric#round Numeric#round passes all of its arguments to Float#round (numeric.c: num_round calls flo_round(argc, argv, rb_Float(num))), so it accepts the half: keyword as well. Use the round_mode alias that Integer#round already uses. The rdoc call-seq on ruby/ruby master is round(digits = 0, half: :up) (96311d13c2), but the generated comment follows the Ruby release used by the RBS Comments workflow, which does not have that fix yet, so the comment is left as generated. Co-Authored-By: Claude Fable 5.1 --- core/numeric.rbs | 4 ++-- test/stdlib/Numeric_test.rb | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/core/numeric.rbs b/core/numeric.rbs index f81b4c79de..e8df26fe42 100644 --- a/core/numeric.rbs +++ b/core/numeric.rbs @@ -668,8 +668,8 @@ class Numeric # Numeric implements this by converting `self` to a Float and invoking # Float#round. # - def round: () -> Integer - | (Integer digits) -> Numeric + def round: (?half: round_mode) -> Integer + | (Integer digits, ?half: round_mode) -> Numeric #