<commit_before>package algebra
package instances

import algebra.ring._

package object bigDecimal extends BigDecimalInstances

trait BigDecimalInstances extends cats.kernel.instances.BigDecimalInstances {
  implicit val bigDecimalAlgebra: BigDecimalAlgebra =
    new BigDecimalAlgebra
}

class BigDecimalAlgebra extends Field[BigDecimal] with Serializable {

  val zero: BigDecimal = BigDecimal(0, java.math.MathContext.UNLIMITED)
  val one: BigDecimal = BigDecimal(1, java.math.MathContext.UNLIMITED)

  def plus(a: BigDecimal, b: BigDecimal): BigDecimal = a + b
  def negate(a: BigDecimal): BigDecimal = -a
  override def minus(a: BigDecimal, b: BigDecimal): BigDecimal = a - b

  def times(a: BigDecimal, b: BigDecimal): BigDecimal = a * b
  def div(a: BigDecimal, b: BigDecimal): BigDecimal = a / b
  def quot(a: BigDecimal, b: BigDecimal) = a.quot(b)
  def mod(a: BigDecimal, b: BigDecimal) = a.remainder(b)

  override def quotmod(a: BigDecimal, b: BigDecimal) = {
    val arr = a.bigDecimal.divideAndRemainder(b.bigDecimal)
    (BigDecimal(arr(0)), BigDecimal(arr(1)))
  }

  override def pow(a: BigDecimal, k: Int): BigDecimal = a pow k

  override def fromInt(n: Int): BigDecimal = BigDecimal(n, java.math.MathContext.UNLIMITED)
  override def fromBigInt(n: BigInt): BigDecimal = BigDecimal(n)
}<commit_msg>Construct all BigDecimal with MathContext.UNLIMITED.<commit_after>package algebra
package instances

import algebra.ring._

package object bigDecimal extends BigDecimalInstances

trait BigDecimalInstances extends cats.kernel.instances.BigDecimalInstances {
  implicit val bigDecimalAlgebra: BigDecimalAlgebra =
    new BigDecimalAlgebra
}

class BigDecimalAlgebra extends Field[BigDecimal] with Serializable {

  val zero: BigDecimal = BigDecimal(0, java.math.MathContext.UNLIMITED)
  val one: BigDecimal = BigDecimal(1, java.math.MathContext.UNLIMITED)

  def plus(a: BigDecimal, b: BigDecimal): BigDecimal = a + b
  def negate(a: BigDecimal): BigDecimal = -a
  override def minus(a: BigDecimal, b: BigDecimal): BigDecimal = a - b

  def times(a: BigDecimal, b: BigDecimal): BigDecimal = a * b
  def div(a: BigDecimal, b: BigDecimal): BigDecimal = a / b
  def quot(a: BigDecimal, b: BigDecimal) = a.quot(b)
  def mod(a: BigDecimal, b: BigDecimal) = a.remainder(b)

  override def quotmod(a: BigDecimal, b: BigDecimal) = {
    val arr = a.bigDecimal.divideAndRemainder(b.bigDecimal)
    (BigDecimal(arr(0)), BigDecimal(arr(1)))
  }

  override def pow(a: BigDecimal, k: Int): BigDecimal = a pow k

  override def fromInt(n: Int): BigDecimal = BigDecimal(n, java.math.MathContext.UNLIMITED)
  override def fromBigInt(n: BigInt): BigDecimal = BigDecimal(n, java.math.MathContext.UNLIMITED)
}
{'fraction_non_alphanumeric': 0.10421286031042129, 'fraction_numerical': 0.0029563932002956393, 'mean_word_length': 5.028953229398664, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '931943', 'n_tokens_mistral': 878, 'n_tokens_neox': 866, 'n_words': 247}