• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-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
16package std.math.consts;
17
18/**
19 * PI as double value
20 */
21export const PI: double = 3.141592653589793;
22
23/**
24 * Euler number as double value
25 */
26export const E: double = 2.718281828459045;
27
28/**
29 * Natural logarithm of 10 as double value
30 */
31export const LN10: double = 2.302585092994046;
32
33/**
34 * Natural logarithm of 2 as double value
35 */
36export const LN2: double = 0.6931471805599453;
37
38/**
39 * Logarithm base 2 of Euler number as double value
40 */
41export const LOG2E: double = 1.4426950408889634;
42
43/**
44 * Logarithm base 10 of Euler number as double value
45 */
46export const LOG10E: double = 0.4342944819032518;
47
48/**
49 * Square root of 1/2 as double value
50 */
51export const SQRT1_2: double = 0.7071067811865476;
52
53/**
54 * Square root of 2 as double value
55 */
56export const SQRT2: double = 1.4142135623730951;
57
58// export const floatEpsion: float = 1.19209e-07;
59// export const floatMinimum: float = 1.17549e-38;
60// export const floatMaximum: float = 3.40282e+38;
61// export const floatNaN: float = 0.0 / 0.0;
62// export const floatInf: float = 1.0 / 0.0;
63// export const floatNegInf: float = -1.0 / 0.0;
64
65/**
66 * Minimal possible difference between two double values
67 */
68export const doubleEpsilon: double = 2.22045e-16;
69
70/**
71 * Minimal value that this type can have as a double
72 */
73export const doubleMinimum: double = 2.2250738585072014E-308;
74
75/**
76 * Maximal value that this type can have as a double
77 */
78export const doubleMaximum: double = 1.7976931348623157E+308;
79
80/**
81 * Represents the NaN value accoring to IEEE 754 specification
82 */
83export const doubleNaN: double = 0.0 / 0.0;
84
85/**
86 * Represents the +Infinity value accoring to IEEE 754 specification
87 */
88export const doubleInf: double = 1.0 / 0.0;
89
90/**
91 * Represents the -Infinity value accoring to IEEE 754 specification
92 */
93export const doubleNegInf: double = -1.0 / 0.0;
94