How to use the bs-platform/lib/js/int64.js.abs function in bs-platform

To help you get started, we’ve selected a few bs-platform examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github plow-technologies / bs-Zarith / lib / js / src / Z.js View on Github external
function ediv_rem$prime$2(_a, _b, _cum) {
  while(true) {
    var cum = _cum;
    var b = _b;
    var a = _a;
    var a$1 = Int64.abs(a);
    var b$1 = Int64.abs(b);
    var r = Caml_int64.sub(a$1, b$1);
    if (Caml_int64.compare(a$1, b$1) === 1) {
      _cum = Caml_int64.add(cum, Int64.one);
      _b = b$1;
      _a = r;
      continue ;
    } else {
      return /* tuple */[
              Caml_int64.add(cum, Int64.one),
              r
            ];
    }
  };
}
github plow-technologies / bs-Zarith / lib / js / src / Z.js View on Github external
function ediv_rem$2(a, b) {
  if (gt$2(a, Int64.minus_one)) {
    return div_rem$2(a, b);
  } else {
    var match = ediv_rem$prime$2(a, b, Int64.zero);
    return /* tuple */[
            Caml_int64.neg(match[0]),
            Int64.abs(match[1])
          ];
  }
}
github plow-technologies / bs-Zarith / lib / js / src / Z.js View on Github external
function ediv_rem$prime$2(_a, _b, _cum) {
  while(true) {
    var cum = _cum;
    var b = _b;
    var a = _a;
    var a$1 = Int64.abs(a);
    var b$1 = Int64.abs(b);
    var r = Caml_int64.sub(a$1, b$1);
    if (Caml_int64.compare(a$1, b$1) === 1) {
      _cum = Caml_int64.add(cum, Int64.one);
      _b = b$1;
      _a = r;
      continue ;
    } else {
      return /* tuple */[
              Caml_int64.add(cum, Int64.one),
              r
            ];
    }
  };
}