Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
NilClass#to_c
() -> ::Complex
to_c → (0+0i)
complex.c
View on GitHub ↗
static VALUE
nilclass_to_c(VALUE self)
{
return rb_complex_new1(INT2FIX(0));
}
Returns zero as a Complex:
Example
nil.to_c # => (0+0i)