mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 06:20:21 +02:00
expf throws floating point underflow exception on every value in VS2017.
switch to IEEE-compatible type double exp git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6099 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@ -57,7 +57,7 @@ typedef f32 generate_func(s16 x, s16 y, f32 s);
|
||||
f32 eggbox(s16 x, s16 y, f32 s)
|
||||
{
|
||||
const f32 r = 4.f*sqrtf((f32)(x*x + y*y))/s;
|
||||
const f32 z = expf(-r * 2) * (cosf(0.2f * x) + cosf(0.2f * y));
|
||||
const f32 z = (f32)exp(-r * 2) * (cosf(0.2f * x) + cosf(0.2f * y));
|
||||
return 0.25f+0.25f*z;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user