From a8c1ddf9b4a13bcfa8ea8e48efdb31d3d83bb624 Mon Sep 17 00:00:00 2001 From: Oskar Eichler Date: Sat, 29 Aug 2026 21:57:29 +0200 Subject: [PATCH] Honor exception false for complex conversion --- ext/bigdecimal/bigdecimal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 99bd9f06..b414ff4e 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -2898,7 +2898,7 @@ rb_convert_to_BigDecimal(VALUE val, size_t digs, int raise_exception) else if (RB_TYPE_P(val, T_COMPLEX)) { VALUE im = rb_complex_imag(val); if (!is_zero(im)) { - /* TODO: handle raise_exception */ + if (!raise_exception) return Qnil; rb_raise(rb_eArgError, "Unable to make a BigDecimal from non-zero imaginary number"); }