Just as a follow up, I just tested with the exponent being an Integer vs a 
Float (i.e. 6 vs 6.0), and I now see the same result as I do with Python 
and C++ using both.

Chris

On Tuesday, December 15, 2015 at 3:35:35 PM UTC-5, Christopher Alexander 
wrote:
>
> Hello all,
>
> I have noted an inaccuracy when using the "^" symbol.  Please see below:
>
> *julia> **1.052500000000004 ^ 6.0*
>
>
> *1.3593541801778923*
> *julia> *
> *1.052500000000004 * 1.052500000000004 * 1.052500000000004 * 
> 1.052500000000004 * 1.052500000000004 * 1.052500000000004*
> *1.3593541801778926*
>
> This yields a difference of:  
>
> *2.220446049250313e-16*
>
>
>
> This might not seem like much of a difference, but it is having an adverse 
> effect on a project I am working on.  To compare, in Python, I don't see 
> any difference:
>
> In[8]: 1.052500000000004 ** 6.0
> Out[8]: 1.3593541801778926
>
> In[9]: 1.052500000000004 * 1.052500000000004 * 1.052500000000004 * 
> 1.052500000000004 * 1.052500000000004 * 1.052500000000004
> Out[9]: 1.3593541801778926
>
> I also see no difference in C++
>
>
> Any idea why this might be?  Just an issue with floating point math?  Is 
> Julia actually being more accurate here?
>
> Thanks!
>
> Chris
>

Reply via email to