| Author |
Go: A question about "methods on types"
|
atul khot
Greenhorn
Joined: Jul 24, 2008
Posts: 23
|
|
Dear Mark,
Here goes ;-) a code snippet from gotour,
What is happening on line 18?
The syntax
-math.Sqrt2
is this the same as
-math.Sqrt(2)
The lack of parenthesis stumped me...
I understand the rest...
--- thanks atul
|
--cheerio atul
|
 |
atul khot
Greenhorn
Joined: Jul 24, 2008
Posts: 23
|
|
I guess math.Sqrt2 is some constant in the math package...
--- cheerio atul
|
 |
Mark Summerfield
author
Ranch Hand
Joined: Jun 20, 2012
Posts: 37
|
|
Hi Atul,
Yes you're right math.Sqrt2 is a predefined constant.
|
Mark Summerfield
"Programming in Go" - http://www.qtrac.eu/gobook.html
|
 |
 |
|
|
subject: Go: A question about "methods on types"
|
|
|