From bug-octave-request at bevo dot che dot wisc dot edu Mon Jan 5 19:54:23 1998 Subject: strange results for multiple .^ From: Sam Sirlin To: bug-octave at bevo dot che dot wisc dot edu Date: Wed, 31 Dec 1997 16:47:12 -0800 (PST) Bug report for Octave 2.0.9 configured for sparc-sun-solaris2.5 Description: ----------- Strange results for multiple .^ in a single line; looks incorrect to me. Certainly is different than matlab Repeat-By: --------- This is a matlab (4.2) run: >> c=[-1 -.999] c = -1.0000e+00 -9.9900e-01 >> c.^(c.^c) ans = -1.0000e+00- 1.2246e-16i -1.0109e+00+ 3.1571e-03i at this stage, octave produces NaN's. Note that octave works ok using c(1)^(c(1)^c(1)) etc. Octave run: octave:1> c=[-1 -0.999] c = -1.00000 -0.99900 octave:2> c.^(c.^c) ans = NaN + NaNi NaN + NaNi octave:3> c(1).^(c(1).^c(1)) ans = -1 octave:4> c(2).^(c(2).^c(2)) ans = -1.0109354 + 0.0031571i Looks like some sort of parsing problem making ^. not quite elementwise if invoked more than once on a line. Configuration (please do not edit this section): ----------------------------------------------- uname output: SunOS kalessin 5.5 Generic_103093-14 sun4u sparc SUNW,Ultra-1 configure opts: --enable-rpath --with-g77 Fortran compiler: g77 FFLAGS: -O F2C: F2CFLAGS: FLIBS: -lf2c -lm -L/usr/ccs/lib -L/usr/lib -L/opt/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2.2.f.2 -L/usr/ccs/bin -L/usr/ccs/lib -L/opt/gnu/lib -lm -lgcc -lc CPPFLAGS: INCFLAGS: -I/usr/local/include -I/usr/local/include/octave-2.0.9 C compiler: gcc, version 2.7.2.2.f.2 CFLAGS: -DHAVE_CONFIG_H -O CPICFLAG: -fPIC C++ compiler: c++, version 2.7.2.2.f.2 CXXFLAGS: -DHAVE_CONFIG_H -fno-implicit-templates -g -O2 -Wall CXXPICFLAG: -fPIC LDFLAGS: -g LIBFLAGS: -L/usr/local/lib RLD_FLAG: -Xlinker -R -Xlinker /usr/local/lib CXXLIBS: -lsocket -lsocket -lst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_FORK=1 -DHAVE_GETCWD=1 -DHAVE_GETEGID=1 -DHAVE_GETEUID=1 -DHAVE_GETGID=1 -DHAVE_GETGRENT=1 -DHAVE_GETGRGID= User-preferences (please do not edit this section): -------------------------------------------------- EDITOR = "emacs" IMAGEPATH = ".:/usr/local/share/octave/2.0.9/imagelib//" INFO_FILE = "/usr/local/info/octave.info" LOADPATH = ".:.:/usr/local/libexec/octave/site/oct/sparc-sun-solaris2.5//:/usr/local/share/octave/site/m//:/usr/local/libexec/octave/2.0.9/oct/sparc-sun-solaris2.5//:/usr/local/share/octave/2.0.9/m///scripts:/home/sam/octave:/home/sam/octave/apl:" OCTAVE_VERSION = "2.0.9" PAGER = "less -e -P'-- less ?pB(%pB\\%):--. (f)orward, (b)ack, (q)uit$'" PS1 = "\\s:\\#> " PS2 = "> " automatic_replot = 0 whitespace_in_literal_matrix = "" default_save_format = "ascii" do_fortran_indexing = 0 empty_list_elements_ok = "warn" eps = 2.22045e-16 gnuplot_binary = "gnuplot" ignore_function_time_stamp = "system" implicit_str_to_num_ok = 0 ok_to_lose_imaginary_part = "warn" output_max_field_width = 10 output_precision = 5 page_screen_output = 1 prefer_column_vectors = 1 prefer_zero_one_indexing = 0 print_answer_id_name = 1 print_empty_dimensions = 1 propagate_empty_matrices = 1 resize_on_range_error = 1 return_last_computed_value = 0 save_precision = 15 silent_functions = 0 split_long_rows = 1 treat_neg_dim_as_zero = 0 warn_assign_as_truth_value = 1 warn_comma_in_global_decl = 1 warn_divide_by_zero = 1