finalized

This commit is contained in:
2025-06-26 22:31:42 +09:00
parent 451aaee7ce
commit 200d0ed8c6
3 changed files with 4 additions and 3 deletions

BIN
output/main-opt-final.pdf Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -15,13 +15,14 @@
\subsection{考察} \subsection{考察}
上記のコードリストは浮動少数点数の演算・変数格納時の誤差を考慮していない。 上記のコードリストは浮動少数点数の演算・変数格納時の誤差を考慮していない。
考慮する場合は\texttt{float.h}内の\texttt{DBL\_MIN}\texttt{DBL\_EPSILON}を用いた判別処理が必要である\cite{cppref_float} 考慮する場合は\texttt{float.h}内の\texttt{DBL\_MIN}\texttt{DBL\_EPSILON}等やそれに準ずる方法を用いた判別処理が必要である\cite{cppref_float}
\begin{lstlisting}[language=C,title={誤差を考慮した比較}] \begin{lstlisting}[language=C,title={誤差を考慮した比較}]
#include <float.h>
#include <math.h> #include <math.h>
if (D == DBL_EPSILON * fmax(1, fmax(fabs(D), 0.0))) { #define DBL_EPSILON 1.0E-16
if (fabs(D) <= DBL_EPSILON) {
puts("superposition"); puts("superposition");
} }
\end{lstlisting} \end{lstlisting}