Recursive CTE calculations

  • hloete

    SSC Enthusiast

    Points: 197

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

  • warnerk

    Grasshopper

    Points: 18

    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.

  • Jonathan AC Roberts

    SSCoach

    Points: 17342

    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

  • dave.hall

    Grasshopper

    Points: 18

    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 4 (of 4 total)

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