mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-11 04:52:21 +02:00
modff failover
This commit is contained in:
parent
ee7c057e25
commit
90de4fd2ea
1 changed files with 10 additions and 0 deletions
|
@ -192,8 +192,18 @@ namespace System
|
||||||
|
|
||||||
[CLink]
|
[CLink]
|
||||||
private static extern double modf(double x, out double intpart);
|
private static extern double modf(double x, out double intpart);
|
||||||
|
|
||||||
|
#if BF_PLATFORM_WINDOWS && BF_64_BIT
|
||||||
[CLink]
|
[CLink]
|
||||||
private static extern float modff(float x, out float intpart);
|
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)
|
public static float Truncate(float f)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue