<commit_before>package thx;

import utest.Assert;
import thx.Decimal;

/*
TODO
1.23E+7
-1.23E-12
0E+7
*/

class TestDecimal {
  public function new() {}

  var divisionSize : Int;

  public function setup() {
    this.divisionSize = Decimal.divisionScale;
    Decimal.divisionScale = 16;
  }

  public function teardown() {
    Decimal.divisionScale = this.divisionSize;
  }

  public function testModulo() {
    Assert.isTrue((10 : Decimal) % 3 == 1);
    Assert.isTrue((10.2 : Decimal) % 3 == 1.2);
    Assert.isTrue(("12345678900000000" : Decimal) %  "0.0000000012345678" == "0.0000000009832122");
    Assert.isTrue((16.80 : Decimal) % 4.10 == "0.4");
    Assert.isTrue((10 : Decimal) % 3 == 1);
    Assert.isTrue((10.2 : Decimal) % 3 == 1.2);

    Assert.isTrue( (10 : Decimal) % -3 ==  1);
    Assert.isTrue((-10 : Decimal) % -3 == -1);
    Assert.isTrue((-10 : Decimal) %  3 == -1);<commit_msg>added tests from exponential notation<commit_after>package thx;

import utest.Assert;
import thx.Decimal;

class TestDecimal {
  public function new() {}

  var divisionSize : Int;

  public function setup() {
    this.divisionSize = Decimal.divisionScale;
    Decimal.divisionScale = 16;
  }

  public function teardown() {
    Decimal.divisionScale = this.divisionSize;
  }

  public function testStringExp() {
    Assert.isTrue(("1.12345e-10" : Decimal) == "0.000000000112345", 'expected ${("0.000000000112345" : Decimal)} but got ${("1.12345e-10" : Decimal)}');
    Assert.isTrue(("1.12345e+10" : Decimal) == "11234500000", 'expected ${("11234500000" : Decimal)} but got ${("1.12345e+10" : Decimal)}');
    Assert.isTrue(("-1.12345e-10" : Decimal) == "-0.000000000112345", 'expected ${("-0.000000000112345" : Decimal)} but got ${("-1.12345e-10" : Decimal)}');
    Assert.isTrue(("-1.12345e+10" : Decimal) == "-11234500000", 'expected ${("-11234500000" : Decimal)} but got ${("-1.12345e+10" : Decimal)}');
    Assert.isTrue(("0E7" : Decimal) == "0", 'expected ${("0" : Decimal)} but got ${("0E7" : Decimal)}');
  }

  public function testModulo() {
    Assert.isTrue((10 : Decimal) % 3 == 1);
    Assert.isTrue((10.2 : Decimal) % 3 == 1.2);
    Assert.isTrue(("12345678900000000" : Decimal) %  "0.0000000012345678" == "0.0000000009832122");
    Assert.isTrue((16.80 : Decimal) % 4.10 == "0.4");
    Assert.isTrue((10 : Decimal) % 3 == 1);
    Assert.isTrue((10.2 : Decimal) % 3 == 1.2);

    Assert.isTrue( (10 : Decimal) % -3 ==  1);
    Assert.isTrue((-10 : Decimal) % -3 == -1);
    Assert.isTrue((-10 : Decimal) %  3 == -1);
{'fraction_non_alphanumeric': 0.19834057684709602, 'fraction_numerical': 0.14895298301066773, 'mean_word_length': 3.5295169946332736, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 10, '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': '4704406', 'n_tokens_mistral': 1191, 'n_tokens_neox': 933, 'n_words': 192}