Login
Create new posts
At least 10 characters
ChineseEnglishJapaneseRussian
Register
func needFloat(x float64) float64 { const c = x * 0.1 const d = c+ 0.2 return d }
这段代码编译通不过,因为x是变量。如何让一个函数的所有量都是不可变量?
附上js的代码:
const needFloat = x => { const c = x * 0.1 const d = c + 0.2 return d }