"use strict";Object.defineProperty(exports, "__esModule", {value: true});

var _chunk6C3VEZWHjs = require('./chunk-6C3VEZWH.js');

// src/Field.ts
var Field_exports = {};
_chunk6C3VEZWHjs.__export.call(void 0, Field_exports, {
  fieldNumber: () => fieldNumber,
  gcd: () => gcd,
  lcm: () => lcm
});
function gcd(E, field) {
  const zero = field.zero;
  const f = (x, y) => E.equals(y, zero) ? x : f(y, field.mod(x, y));
  return f;
}
function lcm(E, F) {
  const zero = F.zero;
  const gcdSF = gcd(E, F);
  return (x, y) => E.equals(x, zero) || E.equals(y, zero) ? zero : F.div(F.mul(x, y), gcdSF(x, y));
}
var fieldNumber = {
  add: (x, y) => x + y,
  zero: 0,
  mul: (x, y) => x * y,
  one: 1,
  sub: (x, y) => x - y,
  degree: (_) => 1,
  div: (x, y) => x / y,
  mod: (x, y) => x % y
};






exports.gcd = gcd; exports.lcm = lcm; exports.fieldNumber = fieldNumber; exports.Field_exports = Field_exports;
