Thanks for the report. Fixed in CVS<br><br>/cvsroot/Insight/Insight/Code/Common/itkVariableLengthVector.h,v <-- itkVariableLengthVector.h<br>new revision: 1.12; previous revision: 1.11<br><br><br>-- <br>Karthik Krishnan
<br>R&D Engineer,<br>Kitware Inc.<br><br><br><div><span class="gmail_quote">On 12/13/07, <b class="gmail_sendername">Emmanuel Christophe</b> <<a href="mailto:emmanuel.christophe@gmail.com">emmanuel.christophe@gmail.com
</a>> 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) is defined as (as well as most operator):<br><br> template< class T > inline Self operator/( T s ) const<br> {<br> Self result( m_NumElements );<br> for( ElementIdentifier i=0; i< m_NumElements; i++ )
<br> {<br> result[i] = m_Data[i] / (static_cast< ValueType >( s ));<br> }<br> return result;<br> }<br><br>Wouldn't it make more sense to apply the cast after the operation, as:<br> result[i] = static_cast< ValueType >( m_Data[i] / 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>