Sunday, April 17, 2022

Re: [update] math/octave 7.1.0

> The most disturbing one is the difference in parsing imaginary parts of
> complex numbers, so using dlmread or str2double is badly broken on
> systems building with libc++:
>
> https://bugs.llvm.org/show_bug.cgi?id=17782

For completeness' sake:

* create a file "dlmread_test"
1;2;3
1i;2j;3J;4j
1;2;3;4
-1i;-2I;-3J;-4j

octave:1> dlmread("dlmread_test")
ans =

1 + 0i 2 + 0i 3 + 0i 0 + 0i
0 + 0i 0 + 2i 0 + 3i 0 + 4i
1 + 0i 2 + 0i 3 + 0i 4 + 0i
0 + 0i 0 + 0i 0 - 3i 0 - 4i

--> it picks up the j's and J's but returns 0 for the imaginary parts
ending with i's or I's.

Likewise:

octave:2> str2double ("4j")
ans = 0 + 4i

octave:3> str2double ("4i")
ans = NaN

That's all consistent with the LLVM bug report. Behavior is the same on
7.1.0 (OpenBSD), 6.4.0 (FreeBSD), 5.2.0 (OpenBSD)

No comments:

Post a Comment