real(), imag(), conj() do not accept rationals. Patchs attached. Help pages updated (with isreal() ones)
@sgougeon)
Reported by Samuel GOUGEON (complex_rationals.zip (39.02 KB, text/plain)
%r_real, %r_imag, %r_conj implemented. Help pages + %r_isreal updated
BUG DESCRIPTION:
----------------
real(), imag() and conj() applied to rationals yield an error. Overloads attached
help pages (en, fr, ja, pt, ru) updated. + UTF-8 encoding forced
Help pages of isreal()
- not updated after being newly implemented for rationals in Scilab 6.
- Default value for eps argin was not documented
=> Help pages updated in attachement.
ERROR LOG:
----------
--> A = [%z/(1-%z) (1-%z)/%z 1/%z^2];
--> B = A(1,$:-1:1);
--> C = A + %i*B;
--> A, real(C)
A =
z 1 - z 1
------ ------ --
2
1 - z z z
Function not defined for given argument type(s),
check arguments or define function %r_real for overloading.
in builtin real
--> B, imag(C)
B =
1 1 - z z
-- ------ ------
2
z z 1 - z
Function not defined for given argument type(s),
check arguments or define function %r_imag for overloading.
in builtin imag
--> conj(C)
Function not defined for given argument type(s),
check arguments or define function %r_conj for overloading.
in builtin conj
--> imag(C), imag(conj(C))
Function not defined for given argument type(s),
check arguments or define function %r_imag for overloading.
in builtin imag
--> real(C), imag(conj(C))
Function not defined for given argument type(s),
check arguments or define function %r_real for overloading.
in builtin real
HOW TO REPRODUCE THE BUG:
-------------------------
A = [%z/(1-%z) (1-%z)/%z 1/%z^2];
B = A(1,$:-1:1);
C = A + %i*B;
A, real(C)
B, imag(C)
conj(C)
imag(C), imag(conj(C))
real(C), imag(conj(C))