浮動小数点エラー
#include<stdio.h>
main (){
float D[5][6] = {
{0,0,151.9058382,111.8925551,238.1626765,145.6362657},
{0,151.9058382,0,256.9532465,317.3522119,232.5861795},
{0,111.8925551,256.9532465,0,181.0294098,114.6471},
{0,238.1626765,317.3522119,181.0294098,0,93.41311845} ,
{0,145.6362657,232.5861795,114.6471,93.41311845,0},
};
float data[100][100] ;
int n=5;
float sum;
int i,l;
for(i=1;i<=n-2;i++)
{
sum=0;
for(l=i+2;l<=n;l++)
{
sum=sum+D[i][l];
}
◎ data[i]=D[i][i+1]/(sum/(n-(D+1))); ←この行
}
for (i=1;i<=n;i++){
printf("%f",data[i]);
}
return (0);
}
上のプログラムで、◎の行に浮動小数点の不正な使用とエラーがでてしまいます。
参考書、ヘルプで調べたもののなぜエラーとなるか分かりませんでした。
解決できますでしょうか?
補足
ptex2004v1を使っています. 単にF=maと入力したときのエラーメッセージは次の通りです.宜しくお願いします. This is TeX, Version 3.14159 (Web2C 7.4.5) (format=latex 2004.3.10) 1 SEP 2006 21:01 **\scrollmode\input{equation.tex} (./equation.tex ! LaTeX Error: \usepackage before \documentclass. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.2 \usepackage[dvips]{ color} \usepackage may only appear in the document preamble, i.e., between \documentclass and \begin{document}. ! Undefined control sequence. l.3 \color [rgb]{0.000,0.000,0.000} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.3 \color[ rgb]{0.000,0.000,0.000} You're in trouble here. Try typing <return> to proceed. If that doesn't work, type X <return> to quit. Missing character: There is no [ in font nullfont! ... Missing character: There is no 0 in font nullfont! No file equation.aux. \openout1 = `equation.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 4. ... LaTeX Font Info: ... okay on input line 4. ! LaTeX Error: The font size command \normalsize is not defined: there is probably something wrong with the class file. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.4 \begin{document} Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it. LaTeX Font Info: External font `cmex10' loaded for size (Font) <7> on input line 5. LaTeX Font Info: External font `cmex10' loaded for size (Font) <5> on input line 5. ! LaTeX Error: The font size command \normalsize is not defined: there is probably something wrong with the class file. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.6 \end{document} Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it. [1] (./equation.aux) ) Here is how much of TeX's memory you used: 9 strings out of 95847 108 string characters out of 1195582 44507 words of memory out of 1000001 3037 multiletter control sequences out of 10000+50000 3640 words of font info for 14 fonts, out of 500000 for 1000 14 hyphenation exceptions out of 1000 19i,4n,12p,64b,150s stack positions out of 1500i,500n,5000p,200000b,5000s Output written on equation.dvi (1 page, 260 bytes).