FAQ: Difference between revisions

Jump to navigation Jump to search
2,017 bytes added ,  30 June 2022
m
adjusted list level for gdb
m (adjusted list level for gdb)
(3 intermediate revisions by 3 users not shown)
Line 52: Line 52:
   John W. Eaton, David Bateman, Søren Hauberg, Rik Wehbring ({{Release Year}}).
   John W. Eaton, David Bateman, Søren Hauberg, Rik Wehbring ({{Release Year}}).
   GNU Octave version {{Release}} manual: a high-level interactive language for numerical computations.
   GNU Octave version {{Release}} manual: a high-level interactive language for numerical computations.
   URL https://www.gnu.org/software/octave/doc/v{{Release}}/
   URL https://octave.org/doc/v{{Release}}/


A [https://en.wikipedia.org/wiki/BibTeX BibTeX] entry for [https://en.wikipedia.org/wiki/LaTeX LaTeX] users is:
A [https://en.wikipedia.org/wiki/BibTeX BibTeX] entry for [https://en.wikipedia.org/wiki/LaTeX LaTeX] users is:
Line 60: Line 60:
     author    = {John W. Eaton and David Bateman and S{\o}ren Hauberg and Rik Wehbring},
     author    = {John W. Eaton and David Bateman and S{\o}ren Hauberg and Rik Wehbring},
     year      = <span>{</span>{{Release Year}}},
     year      = <span>{</span>{{Release Year}}},
     url      = {https://www.gnu.org/software/octave/doc/v{{Release}}/},
     url      = {[https://octave.org/doc/v{{Release}}/ https://octave.org/doc/v{{Release}}/]},
   }
   }


Line 96: Line 96:


* Permission errors
* Permission errors
** '''Solution 1:''' Octave on MS Windows uses VBS scripts to start the program.  You can test whether your system is blocking VBS scripts by doing the following:
** '''Solution 1:''' Octave versions prior to version 7.1.0 on MS Windows used VBS scripts to start the program.  You can test whether your system is blocking VBS scripts by doing the following:
**# Using Notepad or another text editor, create a text file containing only the text: <pre>msgbox("This is a test script, Click OK to close")</pre>
**# Using Notepad or another text editor, create a text file containing only the text: <pre>msgbox("This is a test script, Click OK to close")</pre>
**# Save the file on your Desktop with the name {{Path|testscript.vbs}} (be sure that the editor didn't end it in .txt or .vbs.txt).
**# Save the file on your Desktop with the name {{Path|testscript.vbs}} (be sure that the editor didn't end it in .txt or .vbs.txt).
Line 107: Line 107:
** '''Solution 3:''' Did you install Octave on a network-drive?  Do you have the execution permissions?
** '''Solution 3:''' Did you install Octave on a network-drive?  Do you have the execution permissions?
** '''Solution 4:''' Is your computer managed by your company?  Does your administrator prohibit script execution?
** '''Solution 4:''' Is your computer managed by your company?  Does your administrator prohibit script execution?
===Collecting gdb backtrace information===
The following instructions can help you gather troubleshooting information that may help developers identify the problem if the above steps are ineffective:
* if Octave is 'hanging' (the process is remaining open):
*# attempt to start the Octave GUI
*# with the program stalled (either at the GUI, or with the black terminal window), open the Task Manager (right click on taskbar, select Task manager), switch to the "Details" tab, find `octave-gui.exe` on that list, ad take note of the corresponding PID (process ID)
*# Open the folder where Octave is installed. You should find a file called `cmdshell.bat` in the main folder. Run that file, which should open a MSYS2 bash (command line) window.
*# At that prompt, run `gdb -p <em>PID</em>` where <em>PID</em> is the process ID noted previously.
*# at the gdb prompt, execute `thread apply all bt`.  (If this returns a list longer than one page you may need to 'continue' by typing `c`.)
*# copy and paste that output into a text file and append it to your trouble report at octave.discourse.group or bug report at bugs.octave.org.
* if Octave is immediately crashing and closing:
*# Open the folder where Octave is installed. You should find a file called `cmdshell.bat` in the main folder. Run that file, which should open a MSYS2 bash (command line) window.
*# At that prompt, run `gdb octave`. (that will start gdb attached to the octave executable.)
*# At the gdb prompt, execute `r --gui`.  That should attempt to start the Octave in GUI mode.  The gdb prompt should stay unresponsive as long as octave is running.
*# If octave crashes, the gdb prompt should become responsive again. execute `thread apply all bt`.  (If this returns a list longer than one page you may need to 'continue' by typing `c`.)
*# copy and paste that output into a text file and append it to your trouble report at octave.discourse.group or bug report at bugs.octave.org.


==I do not see any output of my script until it has finished?==
==I do not see any output of my script until it has finished?==
Line 134: Line 150:
==Why is Octave's floating-point computation wrong?==
==Why is Octave's floating-point computation wrong?==


Floating-point arithmetic is an approximation '''in binary''' to arithmetic on real or complex numbers.  Just like you cannot represent 1/3 exactly in decimal arithmetic (0.333333... is only a rough approximation to 1/3), you cannot represent some fractions like <math>1/10</math> exactly in base 2.  In binary, the representation to one tenth is <math>0.0\overline{0011}_b</math> where the bar indicates that it repeats infinitely (like how <math>1/6 = 0.1\overline{6}_d</math> in decimal).  Because this infinite repetition cannot be represented exactly with a finite number of digits, rounding errors occur for values that appear to be exact in decimal but are in fact approximations in binary, such as for example how 0.3 - 0.2 - 0.1 is not equal to zero.
Floating-point arithmetic is an approximation '''in binary''' to arithmetic on real or complex numbers.  Just like you cannot represent 1/3 exactly in decimal arithmetic (0.333333... is only a rough approximation to 1/3 for any finite number of 3s), you cannot represent some fractions like <math>1/10</math> exactly in base 2.  In binary, the representation to one tenth is <math>0.0\overline{0011}_b</math> where the bar indicates that it repeats infinitely (like how <math>1/6 = 0.1\overline{6}_d</math> in decimal).  Because this infinite repetition cannot be represented exactly with a finite number of digits, rounding errors occur for values that appear to be exact in decimal but are in fact approximations in binary, such as for example how 0.3 - 0.2 - 0.1 is not equal to zero.


In addition, some advanced operations are computed by approximation and there is no guarantee for them to be accurate, see [https://en.wikipedia.org/wiki/Rounding#Table-maker.27s_dilemma Table-maker's dilemma] for further references. Their results are system-dependent.
In addition, some advanced operations are computed by approximation and there is no guarantee for them to be accurate, see [https://en.wikipedia.org/wiki/Rounding#Table-maker.27s_dilemma Table-maker's dilemma] for further references. Their results are system-dependent.
153

edits

Navigation menu