• David (unregistered)

    changed NumQuads to 100 and did "pi.bat >pi.txt". Gave me a 2215521 line txt file. 50.9MB. lol. gotta love batch files. 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469

  • Don Cross (unregistered) in reply to David

    Hi David, this is the author of pi.bat. Did you by any chance define either of the environment variables "talk" or "PiDebug"? That would cause the batch file to spew lots of output. Just curious what you saw in this huge amount of output. I ran it with NumQuads=100. Here is what I see:

    pi.bat - By Don Cross - http://cosinekitty.com

    18:05:24.19 - started

    pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725 0270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660 8292540917153643678925903600113305305488204665213841469

    18:07:39.02 - finished pi = 48arctan(1/18) + 32arctan(1/57) - 20*arctan(1/239)

    pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725 0270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660 8292540917153643678925903600113305305488204665213841469

    18:10:29.08 - finished pi = 16arctan(1/5) - 4arctan(1/239)

  • Pegasus (unregistered)

    So I came across this awesome work while looking for a way to get the decimal part of division in batch files (since SET /A only deals with whole numbers.)

    But I've been unsuccessful in getting the lifted DivideByInteger block to work. Any hints?

  • Jay (unregistered)

    can someone please tell me a way I can make this code produce a growing string of pi? I want to make something like a matrix of some assortment for no particular reason.

  • (nodebb)

    cool

    Addendum 2022-11-14 09:37: I appreciate your practical suggestions. Throughout my programming studies, I frequently pondered this. I frequently sought assistance with help with programming assignments mycodinghomework because I wanted to excel. Even after spending a lot of time learning,

Leave a comment on “Stupid Coding Tricks: A Batch of Pi”

Log In or post as a guest

Replying to comment #:

« Return to Article