1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

modff failover

This commit is contained in:
Brian Fiete 2022-07-10 16:10:11 -04:00
parent ee7c057e25
commit 90de4fd2ea

View file

@ -192,8 +192,18 @@ namespace System
[CLink]
private static extern double modf(double x, out double intpart);
#if BF_PLATFORM_WINDOWS && BF_64_BIT
[CLink]
private static extern float modff(float x, out float intpart);
#else
private static float modff(float x, out float intpart)
{
var f = modf(x, var i);
intpart = (.)i;
return (.)f;
}
#endif
public static float Truncate(float f)
{