Recursive CTE calculations

  • Comments posted to this topic are about the item Recursive CTE calculations

  • It is a limitation of the REAL data type for PI.
    I changed that to FLOAT(26), bumped it to the MAXRECURSION of 32767  
    Pi comes out 3.14156335418855

    You'd have to have real time on your hands to do that manually.

  • warnerk - Monday, November 19, 2018 6:33 AM

    It is a limitation of the REAL data type for PI.
    I changed that to FLOAT(26), bumped it to the MAXRECURSION of 32767  
    Pi comes out 3.14156335418855

    You'd have to have real time on your hands to do that manually.

    An easier, faster and more accurate way to get pi in SQL Server is:
    SELECT PI()
    Which returns 3.14159265358979

  • I thought this was a nice little piece of work particularly including Euler's formula as an added application of recursive cte's.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply