KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to understand the design decisions behind the big int api . For example to add two big ints you have to: a := big.NewInt(10) b := big.NewInt(20) c := big.NewInt(0) d := c.Add(a,b) where d is the same as c at the end. The initial zero does not matter a bit. Why not just: a := big.NewInt(10) b := big.NewInt(20) c := big.Add(a,b) Or better yet: a := big.NewInt(10) b := big.NewInt(20) c := a.Add(b) Is there any reason they chose to do it this way? I find it little confusing and have to look it up whenever I use it.
Tags (comma-separated)
Save Edits
Cancel