我需要创建一个在 x ^ 0 上返回 0 的自定义函数,所以我做了以下操作:
function custom_pow(base, exponent)
if exponent == 0
return 0
else
return base^exponent
end
end
⟑(base, exponent) = custom_pow(base, exponent)
另外,如果我关闭并再次打开文件,自定义运算符 ⟑ (\wedgedot) 会更改为 ?
无论如何要让它发挥作用吗?我也在使用 VS Code
正如 @k314159 评论的那样,使用 UTF-8 重新打开解决了这个问题,因为我使用的是 windows-1252