<commit_before>// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// Make sure we use JavaScript semantics when compiling compile-time constants.

const x = 12345678901234567891;
const y = 12345678901234567890;
const z = x - y;

const a = 1.0;
const b = a << 3;  // This would not be valid with Dart semantics.

const c = -0.0;
const d = c << 1;  // This would not be valid with Dart semantics.

foo() => 12345678901234567891 - 12345678901234567890;

main() {
  Expect.equals(0, z);
  Expect.equals(0, x - y);
  Expect.equals(0, foo());
  Expect.isTrue(x is double);
  // TODO(floitsch): we probably want to change this to be true.
  Expect.isFalse(x is int);
  Expect.equals(8, b);
  Expect.equals(8, 1.0 << 3);  // This would not be valid with Dart semantics.
  Expect.isTrue(1 == 1.0);
  Expect.equals(0, d);
  Expect.equals(0, -0.0 << 1);  // This would not be valid with Dart semantics.
  // Make sure the 1 is not shifted into the 32 bit range.
  Expect.equals(0, 0x100000000 >> 3);
  // The dynamic int-check also allows -0.0.
  Expect.isTrue((-0.0) is int);
}<commit_msg>Big doubles are now integers too.<commit_after>// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// Make sure we use JavaScript semantics when compiling compile-time constants.

const x = 12345678901234567891;
const y = 12345678901234567890;
const z = x - y;

const a = 1.0;
const b = a << 3;  // This would not be valid with Dart semantics.

const c = -0.0;
const d = c << 1;  // This would not be valid with Dart semantics.

foo() => 12345678901234567891 - 12345678901234567890;

main() {
  Expect.equals(0, z);
  Expect.equals(0, x - y);
  Expect.equals(0, foo());
  Expect.isTrue(x is double);
  Expect.isTrue(x is int);
  Expect.equals(8, b);
  Expect.equals(8, 1.0 << 3);  // This would not be valid with Dart semantics.
  Expect.isTrue(1 == 1.0);
  Expect.equals(0, d);
  Expect.equals(0, -0.0 << 1);  // This would not be valid with Dart semantics.
  // Make sure the 1 is not shifted into the 32 bit range.
  Expect.equals(0, 0x100000000 >> 3);
  // The dynamic int-check also allows -0.0.
  Expect.isTrue((-0.0) is int);
}
{'fraction_non_alphanumeric': 0.12479541734860884, 'fraction_numerical': 0.10229132569558101, 'mean_word_length': 3.1652470187393527, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '5044916', 'n_tokens_mistral': 1003, 'n_tokens_neox': 809, 'n_words': 327}