• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024-2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16export class AccessNSieve {
17  static readonly n1: int  = 3;
18  static readonly n2: int = 10000;
19  static readonly expected: int = 14302;
20  static isPrime: boolean[]
21
22  public setup(): void {
23    AccessNSieve.isPrime = new boolean[(1 << AccessNSieve.n1) * AccessNSieve.n2 + 1];
24  }
25
26  private static nsieve(m: int): int {
27    let count: int = 0;
28
29    for (le i: int = 2; i <= m; i++) {
30      AccessNSieve.isPrime[i] = true;
31    }
32  }
33}
34/* @@? 29:10 Error TypeError: Unresolved reference le */
35/* @@? 29:13 Error SyntaxError: Expected ';', got 'identification literal'. */
36/* @@? 29:13 Error TypeError: Unresolved reference i */
37/* @@? 29:14 Error SyntaxError: Expected ';', got ':'. */
38/* @@? 29:14 Error SyntaxError: Unexpected token ':'. */
39/* @@? 29:16 Error SyntaxError: Expected ')', got 'int'. */
40/* @@? 29:16 Error SyntaxError: Unexpected token 'int'. */
41/* @@? 29:25 Error TypeError: Bad operand type, the types of the operands must be numeric, same enumeration, or boolean type. */
42/* @@? 29:36 Error SyntaxError: Unexpected token ')'. */
43/* @@? 29:38 Error SyntaxError: Unexpected token '{'. */
44