SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 


#Analytics
#SPSSStatistics
#Analyticstools
 View Only
  • 1.  get wrong result when computing 10**23

    Posted 07/21/20 11:47 AM

    I tried computing 10**23 and got a wrong answer. 10**22 and 10**24 are correct though. What happened ?






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: get wrong result when computing 10**23

    Posted 07/22/20 03:35 PM

    Hi Support Member​ 

    This looks like a rounding issue. SPSS Statistics holds 15 significant digits of precision. The values you are computing are well beyond that. Some values cannot be represented exactly in binary. This is discussed in our documentation in the FAQ

    https://www.ibm.com/support/knowledgecenter/SSLVMB_27.0.0/statistics_mainhelp_ddita/spss/base/faq_double_precision.html

     

    I hope this helps!

     

    Support Member​ (IBM)






    #SPSSStatistics
    #Support
    #SupportMigration


  • 3.  RE: get wrong result when computing 10**23

    Posted 07/22/20 06:06 PM

    Sorry, Dave, the issue here is magnitude, not precision. The 15+ digit precision, stems from double precision floating point hardware. But I see the correct values for all these magnitudes on my system.

    I would like to know what the user is actually seeing.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 4.  RE: get wrong result when computing 10**23

    Posted 07/22/20 08:26 PM

    Support Member​  What format are you using? I note that depending on the format the values are displayed as expected in the Data Editor (e.g. 1.00E+22, 1.00E+23 , 1.00E+24) but the value stored in the cell (for 10**23) is really 9.99E+23 which runs out of precision at 16 decimals and so falls far short of 100000000000000000000000.00. Using the FORMATS and LIST commands, whatever format I choose looks correct. So I assume we have the 'correct' value internally, but run into problems displaying it in the Data Editor.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 5.  RE: get wrong result when computing 10**23

    Posted 07/22/20 09:58 PM

    It's still not decimals. It is significant figures. It's the 10 conversion that then gets shifted. 10. gets converted to binary and then shifted.

    Python gives me

    The mantissa and exponent would be

    0.66174449004242208439, 77

    But I was using scientific notation in Statistics






    #SPSSStatistics
    #Support
    #SupportMigration


  • 6.  RE: get wrong result when computing 10**23

    Posted 07/23/20 06:24 AM

    1.00E+22 ==> 10000000000000000000000.00

    1.00E+23 ==> 99999999999999990000000.00

    1.00E+24 ==> 1000000000000000000000000.00






    #SPSSStatistics
    #Support
    #SupportMigration


  • 7.  RE: get wrong result when computing 10**23

    Posted 07/23/20 06:28 AM

    1.00E+22 ==> 10000000000000000000000.00

    1.00E+23 ==> 99999999999999990000000.00

    1.00E+24 ==> 1000000000000000000000000.00






    #SPSSStatistics
    #Support
    #SupportMigration