csvTextScan() and csvRead() that uses it are broken for input complex numbers: csvTextScan("1-i") now returns %i
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
csvTextScan() and csvRead() that uses it are broken for input complex numbers:
Scilab 6.0.2 : OK
-----------------
--> csvTextScan(["Inf" "1-i" "i" "Infi" "1+Nani" "Nan-i"])
ans =
Inf
1. - i
i
Infi
1. + Nani
Nan - i
Scilab 6.1.0 :
------------
--> csvTextScan(["Inf" "1-i" "i" "Infi" "1+Nani" "Nan-i"])
ans =
Inf + 0.i
0. + i <<<<<< WRONG
Nan + 0.i <<<<<< WRONG
0. + Infi
1. + Nani
0. + Nani <<<<<< WRONG
This is a critical bug because csvRead() was the only function able to handle complex numbers. There is no easy workaround.
ERROR LOG:
----------
None. Wrong answer
HOW TO REPRODUCE THE BUG:
-------------------------
text = ["Inf" "1-i" "i" "Infi" "1+Nani" "Nan-i"];
csvTextScan(text)
File = TMPDIR + "/bug_16508.txt";
mputl(text, File);
csvRead(File)