octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63383] Error in sscanf in special cases when


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #63383] Error in sscanf in special cases when '%f' conversion is used
Date: Fri, 18 Nov 2022 14:34:43 -0500 (EST)

Update of bug #63383 (project octave):

                  Status:                    None => Confirmed              
                 Release:                   other => dev                    

    _______________________________________________________

Follow-up Comment #1:

This error happens because Octave is trying to parse "nan" and is detecting a
conversion error (so only three values are returned) but failing to correctly
set the error message.  You'll also see that the position is also not set
correctly if you try


[val, count, msg, pos] = sscanf ('1 2 3 n', '%f')


This problem also happens if you replace 'n' with 'i', and you can also see
what I think is a position error with '%d' in the following example:


octave> [val, count, msg, pos] = sscanf ('1 2 3 -', '%d')
val =

   1
   2
   3

count = 3
msg = sscanf: format failed to match
pos = 8


What does Matlab do for this case?


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63383>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]