bug 441: double precision issue on x86 32bit systems.
This commit is contained in:
@@ -165,7 +165,8 @@ void OnOffApplication::CancelEvents ()
|
||||
{ // Cancel the pending send packet event
|
||||
// Calculate residual bits since last packet sent
|
||||
Time delta(Simulator::Now() - m_lastStartTime);
|
||||
m_residualBits += (uint32_t)(m_cbrRate.GetBitRate() * delta.GetSeconds());
|
||||
Scalar bits = delta * Scalar (m_cbrRate.GetBitRate ()) / Seconds (1.0);
|
||||
m_residualBits += (uint32_t)bits.GetDouble ();
|
||||
}
|
||||
Simulator::Cancel(m_sendEvent);
|
||||
Simulator::Cancel(m_startStopEvent);
|
||||
|
||||
Reference in New Issue
Block a user