Skip to content

Commit 552b00b

Browse files
committed
Fix Math.isFinite on Haxe 5
1 parent 16d5977 commit 552b00b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

std/cxx/_std/Math.hx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ extern class Math {
111111
@:native("round")
112112
public extern static function fround(v:Float): Float;
113113

114+
#if haxe5
115+
116+
@:include("cmath", true)
117+
@:nativeFunctionCode("std::isfinite((double){arg0})")
118+
public extern overload static function isFinite(f: Float): Bool;
119+
120+
#else
121+
114122
@:include("cmath", true)
115123
@:native("std::isfinite")
116124
public extern overload static function isFinite(f: Float): Bool;
@@ -119,6 +127,8 @@ extern class Math {
119127
@:nativeFunctionCode("std::isfinite((double){arg0})")
120128
public extern overload static function isFinite(f: Int): Bool;
121129

130+
#end
131+
122132
@:include("cmath", true)
123133
@:native("std::isnan")
124134
public extern static function isNaN(f: Float): Bool;

0 commit comments

Comments
 (0)