title: golang: Why do I get +Inf instead of an integer or a float?
body: <p>I am learning golang, working on time value of money computations</p>
  
  <p>I am trying to compute for number of period to say, double your money. The formula that I am using is <a href="http://en.wikipedia.org/wiki/Time_value_of_money#Example_3%3a_Solving_for_the_period_needed_to_double_money" rel="noreferrer">period = log(fv/pv) / log(1 + i)</a>. What I have so far is...</p>
  
  <pre><code>package main
  import (
      "fmt"
      "math"
  )
  var (
      interest,
      futureValue,
      period,
      presentValue float64
  )
  var rate float64 = interest / 100 //converts interest into decimal... interest / 100
  var ratex float64 = 1 + interest //used for (1 + i)
  
  func main() {
      numPeriod()
  }
  func numPeriod() {
      fmt.Println("Enter interest amount: ")
      fmt.Scanf("%g", &amp;interest)
      fmt.Println("Enter present value: ")
      fmt.Scanf("%g", &amp;presentValue)
      fmt.Println("Enter future value: ")
      fmt.Scanf("%g", &amp;futureValue)
      var logfvpvFactor float64 = futureValue / presentValue
      var logi float64 = math.Log(ratex)
      var logfvpv float64 = math.Log(logfvpvFactor)
      period = logfvpv / logi
      fmt.Printf("Number of period/s is = %g\n", period)
  }
  </code></pre>
  
  <p>Running this, I get...</p>
  
  <pre><code>Number of period/s is = +Inf
  </code></pre>
  
  <p>...the answer I was looking for is either an integer or a float. How do I get that?</p>
  
  <p>Thanks for your help!</p>