mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 14:47:35 +00:00
LibWeb: Change calc node representation from float to double
This commit is contained in:
parent
f5da6d61b4
commit
421559d725
22 changed files with 75 additions and 75 deletions
|
@ -15,13 +15,13 @@ Time::Time(int value, Type type)
|
|||
{
|
||||
}
|
||||
|
||||
Time::Time(float value, Type type)
|
||||
Time::Time(double value, Type type)
|
||||
: m_type(type)
|
||||
, m_value(value)
|
||||
{
|
||||
}
|
||||
|
||||
Time Time::make_seconds(float value)
|
||||
Time Time::make_seconds(double value)
|
||||
{
|
||||
return { value, Type::S };
|
||||
}
|
||||
|
@ -36,13 +36,13 @@ ErrorOr<String> Time::to_string() const
|
|||
return String::formatted("{}s", to_seconds());
|
||||
}
|
||||
|
||||
float Time::to_seconds() const
|
||||
double Time::to_seconds() const
|
||||
{
|
||||
switch (m_type) {
|
||||
case Type::S:
|
||||
return m_value;
|
||||
case Type::Ms:
|
||||
return m_value / 1000.0f;
|
||||
return m_value / 1000.0;
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
@ -51,9 +51,9 @@ double Time::to_milliseconds() const
|
|||
{
|
||||
switch (m_type) {
|
||||
case Type::S:
|
||||
return static_cast<double>(m_value) * 1000.0;
|
||||
return m_value * 1000.0;
|
||||
case Type::Ms:
|
||||
return static_cast<double>(m_value);
|
||||
return m_value;
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue