mirror of
https://github.com/g-truc/glm.git
synced 2025-04-21 12:39:37 +00:00
fix: fastExp promotion
implicit conversion increases floating-point precision: 'float' to 'double'
This commit is contained in:
parent
b3f8772026
commit
d9124820ed
1 changed files with 2 additions and 2 deletions
|
@ -112,7 +112,7 @@ namespace glm
|
|||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType fastExp2(genType x)
|
||||
{
|
||||
return fastExp(0.69314718055994530941723212145818f * x);
|
||||
return fastExp(static_cast<genType>(0.69314718055994530941723212145818) * x);
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
|
@ -125,7 +125,7 @@ namespace glm
|
|||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType fastLog2(genType x)
|
||||
{
|
||||
return fastLog(x) / 0.69314718055994530941723212145818f;
|
||||
return fastLog(x) / static_cast<genType>(0.69314718055994530941723212145818);
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
|
|
Loading…
Add table
Reference in a new issue