title: Find the modo value
body: <p>I have given a log value <code>Y</code> , i want to calculate the anti log of Y i.e </p>
  
  <pre><code>ans = (Math.pow(10,Y))%mod
  </code></pre>
  
  <p>where <code>mod = 1e9+7</code> and the anti log of Y will always be integer i.e<br> Y is calculate as follow <code>Y= log(a)   a is very large integer of range 10^100000</code></p>
  
  <p>So for given Y i need to calculate ans ? How to do that considering the mod operation.</p>
  
  <p><strong>My Approach</strong></p>
  
  <pre><code>double D = Y -(int)Y
  long Pow = (long)Y
  
    for(int i=1;i&lt;=Pow;i++) ans = (ans*10)%mod;
  
    ans = (ans*Math.pow(10,D))%mod
  </code></pre>
  
  <p>But it's not correct can someone suggest be efficient approach here ? BigDecimal can be useful there ?<br>
  <strong>For Example:</strong></p>
  
  <pre><code>Y = 16.222122660468525
  </code></pre>
  
  <p>Using the straight forward method and rounding off i.e <code>Math.log(10,Y)</code> give me <code>1667718169966651</code> but using loops it's give me <code>16677181699666510</code>. I am not using mod now just explaining that there is an error.</p>
  
  <p>Here <code>Y</code> is small so direct method works and we can take mod easily. if Y is range of 10000 it will not work and overflow so we have to used mod.</p>