Go语言的单目加/减运算符

以下摘自The Go Programming Language

There are also unary addition and subtraction operators:
+ unary positive (no effect)
– unary negation
For integers, +x is a shorthand for 0+x and -x is a shorthand for 0-x; for floating-point and complex numbers, +x is just x and -x is the negation of x.

 

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理