Skip to content

Commit 57da755

Browse files
committed
define the math constants as true Nushell constants
related to #9773
1 parent 52fd600 commit 57da755

1 file changed

Lines changed: 5 additions & 22 deletions

File tree

crates/nu-std/std/math.nu

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
1-
# return the Euler-Mascheroni constant
2-
#
3-
# see https://en.wikipedia.org/wiki/Euler%27s_constant
4-
export def gamma [] { 0.5772156649015329 }
5-
6-
# return the e constant
7-
#
8-
# see https://en.wikipedia.org/wiki/E_(mathematical_constant)
9-
export def e [] { 2.718281828459045 }
10-
11-
# return the pi constant
12-
#
13-
# see https://en.wikipedia.org/wiki/Pi
14-
export def pi [] { 3.141592653589793 }
15-
16-
# return the tau constant, which is double pi
17-
export def tau [] { 6.283185307179586 }
18-
19-
# return the golden ration
20-
#
21-
# see https://en.wikipedia.org/wiki/Golden_ratio
22-
export def phi [] { 1.618033988749895 }
1+
export const GAMMA = 0.5772156649015329
2+
export const E = 2.718281828459045
3+
export const PI = 3.141592653589793
4+
export const TAU = 6.283185307179586
5+
export const PHI = 1.618033988749895

0 commit comments

Comments
 (0)