0
Fixed

Bug in function isreal

Michael_ vor 7 Jahren aktualisiert von Pavel Holoborodko vor 7 Jahren 2

Hello Pavel.


I found another bug in the isreal() function.


If we store real and complex data in the same array, the function isreal() gives always 0, even for entries with 0 imaginary part.


test(1,1)=mp('1i');
test(1,2)=mp('1');
isreal(test(1,1))
isreal(test(1,2))

ans =

  logical

   0

ans =

  logical

   0

This is differnt compared to the standard Matlab behaviour:


test(1,1)=1i;
test(1,2)=1;
isreal(test(1,1))
isreal(test(1,2))

ans =

  logical

   0

ans =

  logical

   1

Best regards,

Michael

Fixed

Dear Michael,


Thank you for reporting this (nasty) bug!

It has been fixed in trunk - fix will be included in next updates for all platforms.


Please use M-language workaround until then (e.g. use imag(x)==0 in isreal routine in mp.m).


Thank you!

Btw, fixed version for Windows is already available (please download it using big green button on our webpage).