<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>Getting SING errors</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hello!</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I'm getting SING errors from the log() function. Here is the code inside the vbr_analysis() function.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"> if (ener<60000)</FONT>
<BR><FONT SIZE=2 FACE="Arial"> {</FONT>
<BR><FONT SIZE=2 FACE="Arial"> if (vbr->consec_noise>2)</FONT>
<BR><FONT SIZE=2 FACE="Arial"> qual-=0.5*(log(3.0 + vbr->consec_noise)-log(3));</FONT>
<BR><FONT SIZE=2 FACE="Arial"> if (ener<10000&&vbr->consec_noise>2)</FONT>
<BR><FONT SIZE=2 FACE="Arial"> qual-=0.5*(log(3.0 + vbr->consec_noise)-log(3));</FONT>
<BR><FONT SIZE=2 FACE="Arial"> if (qual<0)</FONT>
<BR><FONT SIZE=2 FACE="Arial"> qual=0;</FONT>
<BR><FONT SIZE=2 FACE="Arial"> qual += .3*log(ener/60000.0);</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Inspecting the values shows that 'ener' is zero, which leads to the error.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">The question I have is if the code above should explicitly be checking for zero? Or I have an issue with my compiler screwing something up?</FONT></P>
<P><FONT SIZE=2 FACE="Arial">The error doesn't occur constantly, but frequently enough to be a huge nuissance.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Thanks in advance,</FONT>
<BR><FONT SIZE=2 FACE="Arial">Alex</FONT>
</P>
</BODY>
</HTML>