Thanks for the report. Fixed in CVS<br><br>/cvsroot/Insight/Insight/Code/Common/itkVariableLengthVector.h,v&nbsp; &lt;--&nbsp; itkVariableLengthVector.h<br>new revision: 1.12; previous revision: 1.11<br><br><br>-- <br>Karthik Krishnan
<br>R&amp;D Engineer,<br>Kitware Inc.<br><br><br><div><span class="gmail_quote">On 12/13/07, <b class="gmail_sendername">Emmanuel Christophe</b> &lt;<a href="mailto:emmanuel.christophe@gmail.com">emmanuel.christophe@gmail.com
</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>I noticed that the operator / for VariableLengthVector (in<br>
itkVariableLengthVector.h)&nbsp;&nbsp;is defined as (as well as most operator):<br><br>&nbsp;&nbsp;template&lt; class T &gt; inline Self operator/( T s ) const<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;Self result( m_NumElements );<br>&nbsp;&nbsp;&nbsp;&nbsp;for( ElementIdentifier i=0; i&lt; m_NumElements; i++ )
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result[i] = m_Data[i] / (static_cast&lt; ValueType &gt;( s ));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;return result;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>Wouldn&#39;t it make more sense to apply the cast after the operation, as:<br> result[i] = static_cast&lt; ValueType &gt;( m_Data[i] /&nbsp;&nbsp;s );
<br><br>In the situation where the VariableLengthVector is templated on int<br>and s on double, the result would be closer to what is expected by the<br>user.<br><br>Regards,<br>Emmanuel<br>_______________________________________________
<br>Insight-users mailing list<br><a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote>
</div>