codewars / codewars-runner-cli

Old CodeRunner project. See https://github.com/codewars/runner instead.
GNU Affero General Public License v3.0
400 stars 141 forks source link

Haxe: Type not found : Int64 #826

Closed g964 closed 4 years ago

g964 commented 4 years ago

CW Haxe has no Int64: 5317636 * 2306 gives -622433272 instead of 12262468616. It seems Haxe 4.1.2 has them.

kazk commented 4 years ago

Haxe 4.0 seems to have Int64 too. https://api.haxe.org/v/4.0.0/haxe/Int64.html

Not sure why I get Type not found : Int64 :/

kazk commented 4 years ago

You need to import haxe.Int64.

import utest.Assert;
import haxe.Int64;
import Solution;

class SolutionTest extends utest.Test {
  function testExample() {
    var expected = Int64.fromFloat(5317636) * Int64.fromFloat(2306);
    Assert.same(expected, Example.multiply(Int64.fromFloat(5317636), Int64.fromFloat(2306)));
    Assert.equals("12262468616", Int64.toStr(expected));
  }
}
g964 commented 4 years ago

I had gotten Type not found : Int64 too. Ok for "import haxe.Int64", I will try. Thanks!