mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
refs #396 move Blackmisc Math classes into subfolder
This commit is contained in:
@@ -63,8 +63,8 @@ namespace BlackMisc
|
||||
quint32 d = static_cast<quint32>(f / channelSpacingKHz);
|
||||
frequency.switchUnit(CFrequencyUnit::MHz());
|
||||
double f0 = frequency.valueRounded(CFrequencyUnit::MHz(), 3);
|
||||
double f1 = CMath::round(d * (channelSpacingKHz / 1000.0), 3);
|
||||
double f2 = CMath::round((d + 1) * (channelSpacingKHz / 1000.0), 3);
|
||||
double f1 = CMathUtils::round(d * (channelSpacingKHz / 1000.0), 3);
|
||||
double f2 = CMathUtils::round((d + 1) * (channelSpacingKHz / 1000.0), 3);
|
||||
bool down = qAbs(f1 - f0) < qAbs(f2 - f0); // which is the closest value
|
||||
frequency.setCurrentUnitValue(down ? f1 : f2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user