title: SQL Server : An invalid floating point operation occurred
body: <pre><code>Declare @adjustedCurve float
  Declare @difLog float
  Declare @power float
  Declare @valueToAdjust float = 38853.587145
  Declare @lastValue float = 44930.63473
  Declare @expValue float = 39446.17143
  
  
  Set @difLog = log(@lastValue) -log(@expValue)
  Set @power = exp(@difLog)
  Set @adjustedCurve = @power  * @valueToAdjust 
  
  Select @adjustedCurve
  </code></pre>
  <p>This takes part of a function, that is used on a query.
  I know this works fine by itself, but not in the context of the query.</p>
  <p>The error is not in <code>@diflog</code> or <code>@power</code> (I tested separately, and they work fine).<br />
  The problem is with the final multiplication.<br />
  All values are <code>float</code>. But I tested with <code>decimal(15,5)</code> and the problem remains.</p>
  <p>Any ideas?</p>