我运行这段代码,会抛出这样的错误
ERROR: LoadError: syntax: “2” is not a valid function argument name
Stacktrace:
[1] include at .\boot.jl:317 [inlined]
[2] include_relative(::Module, ::String) at .\loading.jl:1038
[3] include(::Module, ::String) at .\sysimg.jl:29
[4] exec_options(::Base.JLOptions) at .\client.jl:229
[5] _start() at .\client.jl:421
in expression starting at C:\Users\叶芝秋\Desktop\Madalung\Madelung.jl:31
[Finished in 2.9s]
其中第31行即是下面函数的第一行!
function MadelungFFC48(N::Int64)
m1, m2, m3 = 0.0, 0.0, 0.0
for n1 ∈ 1:N
# 坐标轴上: 1/8
# 面对角线: 1/4 × 1/√2 = √2/8
# 体对角线: 1/6 × 1/√3 = √3/18
e1 = pow_minus1(n1)
m1 += (√2/8 + e1 * (1/8 + √3/18)) / n1
for n2 ∈ n1+1:N
e2 = pow_minus1(n2), e3 = e1 * e2;
n12, n22 = n1^2, n2^2, n32 = n12 + n22
# 在三棱锥面上的原子, 1/2
m2 += e3 / √(n32) # z = 0
m2 += e2 / √(n32 + n12) # x = y
m2 += e1 / √(n32 + n22) # y = z
# 三棱锥内部的原子
e3 *= e2
for n3 ∈ n2+1:N
e3 = -e3
m3 += e3 / √(n32 + n3^2)
end
end
end
return -48(m1 + m2/2 + m3)
end
麻烦了,各位大神