This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Other Languages and the fly likes Go: A question about Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "Go: A question about "methods on types"" Watch "Go: A question about "methods on types"" New topic
Author

Go: A question about "methods on types"

atul khot
Greenhorn

Joined: Jul 24, 2008
Posts: 29
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: 29
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Go: A question about "methods on types"
 
Similar Threads
How to round a float with a 0.25 step
Display an array in a swing type box
LinkedHashMap - trying to use the method removeEldestEntry
setting precision for float values
Multiple Actions issue in JSF