11 Replies Latest reply on Mar 31, 2010 1:35 PM by (O_O)

    x * x ≠ x^2 ???

    comment_1

      Summary

      x * x ≠ x^2 ???

      Description of the issue

      I am not sure this qualifies as a bug as such, but it is a very strange behavior that could indicate a possible bug.  To reproduce, open Data Viewer and type the following expression: 10^203 * 10^203 The result is, quite correctly, 1.0e+406.  Now change the expression to: (10^203)^2 This produces an error (Error#14 - Out of range).  

        • 1. Re: x * x ≠ x^2 ???
          TSGal

          comment:

           

          Thank you for your post.

           

          Yes, I can replicate the problem.  This works properly up to 1e+404, and definitely fails with 1e+406 and larger.  This occurs on both Windows and Mac platform.

           

          I have forwarded your post along with my findings to our Development and Software Quality Assurance (Testing) departments for review and confirmation.  If I receive an explanation, I will let you know.

           

          TSGal

          FileMaker, Inc.

          • 2. Re: x * x ≠ x^2 ???
            LaRetta_1

            It is strange, but on Windows in vs. 9.0v3, 10.0v3 and now 11, we get same result on 10^203 * 10^203 of 1.0e+406.  But on (10^203)^2, all we have ever gotten is a question mark in the data viewer.   I am curious how you could get an error number for the result in the data viewer.  Or are you using it in a script and referring to Last Error?

             

            Regardless, it appears to be broken in vs. 11as well.

            • 3. Re: x * x ≠ x^2 ???
              comment_1

              Sorry, I wasn't entirely clear:

               

              (10^203)^2

              returns ?

               

              EvaluationError ( (10^203)^2  )

              returns 14

              • 4. Re: x * x ≠ x^2 ???
                (O_O)

                Not saying one way or another about the situation, but just wanted to point out in the specification for FileMaker Pro :

                 

                • Number: Support values from 10^-400 up to 10^400 and the negative values of the same range. Index based on the first 400 significant digits. Up to 1 billion characters per field. The first 400 digits are indexed.

                 

                The result is above 10e400.

                • 5. Re: x * x ≠ x^2 ???
                  TSGal

                  All:

                   

                  The information I received back from Development and Testing confirms what "oki182" says.  In specific:

                   

                  "We don't support numbers past 10e+400, so I suppose Calc1 should also return ?."

                   

                  This inconsistency has been confirmed and sent on to Development.

                   

                  TSGal

                  FileMaker, Inc.

                  • 6. Re: x * x ≠ x^2 ???
                    comment_1

                    Here's another one, and it has nothing to do with the range limit. Paste this into your Data Viewer:

                     

                    Let (
                    n = 1.0000000009
                    ;
                    1060 * n*n
                    &¶&
                    1060 * n^2

                    )

                     

                    It's obvious that n*n is evaluated differently than n^2. It seems that n*n is more precise (both return the same result if SetPrecision is used).

                     



                    • 7. Re: x * x ≠ x^2 ???
                      TSGal

                      comment:

                       

                      Thanks for the example.   From your original post, it was quite evident that "x*x" was being evaluated differently than "x^2".

                       

                      Just to show another difference, if you have (n*n), you get another result.

                       

                      I have entered a new issue, related to the original issue, using your new example along with my findings.  If any additional information becomes available, I will let you know.

                       

                      TSGal

                      FileMaker, Inc.

                      • 8. Re: x * x ≠ x^2 ???
                        comment_1

                        That's a good catch with the parentheses, since 1060 * n*n is actually (1060 * n) * n so it should be evaluated differently than 1060 * n^2.

                         

                        But I cannot find a good reason why n * 1060 * n and n * n * 1060 are calculated to a different precision.

                        • 9. Re: x * x ≠ x^2 ???
                          (O_O)

                          The difference is precision/truncation during the calculation.

                           

                          Let (n = 1.0000000009;

                          1060*SetPrecision (n*n;32) &¶&

                          1060*SetPrecision (n^2;32)

                          )

                           

                          The two values will equal the same when you calculate the whole precision.

                          • 10. Re: x * x ≠ x^2 ???
                            (O_O)

                            Also to note :

                            Let (n = 1.0000000009;

                            SetPrecision (1060*n*n;32)&¶&

                            SetPrecision (1060*n^2;32)

                            )

                             

                            is also showing the correct values.

                            • 11. Re: x * x ≠ x^2 ???
                              (O_O)

                              Just as a note, FileMaker's default precision is 16.  

                              Your calculation goes beyond 16 decimal places.