소스 검색

[tests] add test for 10783

closes #10783
Simon Krajewski 1 년 전
부모
커밋
b614185627
1개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  1. 17 0
      tests/unit/src/unit/issues/Issue10783.hx

+ 17 - 0
tests/unit/src/unit/issues/Issue10783.hx

@@ -0,0 +1,17 @@
+package unit.issues;
+
+class Issue10783 extends Test {
+	function test() {
+		eq(4, log2Unsigned(16));
+	}
+
+	@:pure inline function log2Unsigned(n:Int):Int {
+		var res = 0;
+
+		while ((n >>>= 1) != 0) {
+			res++;
+		}
+
+		return res;
+	}
+}