Float does not appear to have enough precision for the calculation

This commit is contained in:
John Ronan 2017-06-04 10:27:49 +01:00
parent f3ddcce744
commit bce9840cb1

View file

@ -150,8 +150,8 @@ void CAPRSWriter::sendIdFrames()
char desc[100U];
if (m_txFrequency != 0U) {
float offset = float(int(m_rxFrequency) - int(m_txFrequency)) / 1000000.0F;
::sprintf(desc, "MMDVM Voice %.5lfMHz %c%.4lfMHz",
float(m_txFrequency) / 1000000.0F,
::sprintf(desc, "MMDVM Voice %.5LfMHz %c%.4lfMHz",
float(m_txFrequency) / 1000000.0L,
offset < 0.0F ? '-' : '+',
::fabs(offset));
} else {