Feature #5623 ยป 0001-Add-documentation-to-Complex.patch
| complex.c | ||
|---|---|---|
|
rb_define_method(rb_cFloat, "angle", float_arg, 0);
|
||
|
rb_define_method(rb_cFloat, "phase", float_arg, 0);
|
||
|
/*
|
||
|
* Define-const: I = (0+1i)
|
||
|
*/
|
||
|
rb_define_const(rb_cComplex, "I",
|
||
|
f_complex_new_bang2(rb_cComplex, ZERO, ONE));
|
||
|
}
|
||
| lib/complex.rb | ||
|---|---|---|
|
Math = CMath
|
||
|
end
|
||
|
# Deprecated
|
||
|
def Complex.generic? (other)
|
||
|
other.kind_of?(Integer) ||
|
||
|
other.kind_of?(Float) ||
|
||
| ... | ... | |
|
class Numeric
|
||
|
# Deprecated
|
||
|
def im() Complex(0, self) end
|
||
|
end
|
||