comparison NEWS @ 19420:f054112912df

Change strfind to return empty array for empty pattern for compatibility (bug #43649). * NEWS: Announce change. * strfind.cc (Fstrfind): Add note to docstring about change. Return Matrix () if pattern is empty.
author Rik <rik@octave.org>
date Fri, 05 Dec 2014 22:17:09 -0800
parents cc6000ccd627
children 9e5b64b3c1fe
comparison
equal deleted inserted replaced
19419:3b4d6780d6b8 19420:f054112912df
36 from previous versions of Octave when the input is outside the principal 36 from previous versions of Octave when the input is outside the principal
37 branch ([-1, 1]). If the real portion of the input is greater than 1 then 37 branch ([-1, 1]). If the real portion of the input is greater than 1 then
38 the limit from below is taken. If the real portion is less than 1 then the 38 the limit from below is taken. If the real portion is less than 1 then the
39 limit from above is taken. This criteria is consistent with several other 39 limit from above is taken. This criteria is consistent with several other
40 numerical analysis software packages. 40 numerical analysis software packages.
41
42 ** strfind changes when using empty pattern ("") for Matlab compatibility
43
44 strfind now returns an empty array when the pattern itself is empty.
45 In previous versions of Octave, strfind matched at every character
46 location when the pattern was empty.
47
48 NEW
49 strfind ("abc", "") => []
50 OLD
51 strfind ("abc", "") => [1, 2, 3, 4]
41 52
42 ** Integer formats used in the printf family of functions now work for 53 ** Integer formats used in the printf family of functions now work for
43 64-bit integers and are more compatible with Matlab when printing 54 64-bit integers and are more compatible with Matlab when printing
44 non-integer values. Now instead of truncating, Octave will switch 55 non-integer values. Now instead of truncating, Octave will switch
45 the effective format to '%g' in the following circumstances: 56 the effective format to '%g' in the following circumstances: