mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 12:40:23 +00:00
(Qt) Replace some unnecessary pow usage
This commit is contained in:
parent
6df4ab4982
commit
547c88259d
@ -966,7 +966,7 @@ FloatSlider::FloatSlider(rarch_setting_t *setting, QWidget *parent) :
|
||||
if (match.hasMatch())
|
||||
m_precision = pow(10, match.captured(1).toInt());
|
||||
else
|
||||
m_precision = pow(10, 3);
|
||||
m_precision = 10 * 10 * 10;
|
||||
|
||||
setMinimum(setting->enforce_minrange ? setting->min * m_precision : 0.00 * m_precision);
|
||||
setMaximum(setting->enforce_maxrange ? setting->max * m_precision : 999.00 * m_precision);
|
||||
|
@ -1029,7 +1029,8 @@ static void scan_finished_handler(retro_task_t *task,
|
||||
static double expScale(double inputValue, double midValue, double maxValue)
|
||||
{
|
||||
double M = maxValue / midValue;
|
||||
double C = log(pow(M - 1, 2));
|
||||
double base = M - 1;
|
||||
double C = log(base * base);
|
||||
double B = maxValue / (exp(C) - 1);
|
||||
double A = -1 * B;
|
||||
double returnValue = A + B * exp(C * inputValue);
|
||||
|
Loading…
x
Reference in New Issue
Block a user