mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Fix C++ floating point literal formatting (#2114)
Found formatting errors with this regex "([^a-z0-9\.]\.[0-9]|[^a-z0-9\.][0-9]\.[^a-z0-9\.])" and ignored false positives. Fixes #2112.
This commit is contained in:
committed by
Peter Johnson
parent
3d1ca856b2
commit
ffa4b907c0
@@ -128,13 +128,13 @@ void RobotDrive::Drive(double outputMagnitude, double curve) {
|
||||
if (curve < 0) {
|
||||
double value = std::log(-curve);
|
||||
double ratio = (value - m_sensitivity) / (value + m_sensitivity);
|
||||
if (ratio == 0) ratio = .0000000001;
|
||||
if (ratio == 0) ratio = 0.0000000001;
|
||||
leftOutput = outputMagnitude / ratio;
|
||||
rightOutput = outputMagnitude;
|
||||
} else if (curve > 0) {
|
||||
double value = std::log(curve);
|
||||
double ratio = (value - m_sensitivity) / (value + m_sensitivity);
|
||||
if (ratio == 0) ratio = .0000000001;
|
||||
if (ratio == 0) ratio = 0.0000000001;
|
||||
leftOutput = outputMagnitude;
|
||||
rightOutput = outputMagnitude / ratio;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user