Skip to content

Instantly share code, notes, and snippets.

@donno2048
Created September 30, 2023 18:56
Show Gist options
  • Save donno2048/08b047e0fc216f2d2b79da5d29303963 to your computer and use it in GitHub Desktop.
Save donno2048/08b047e0fc216f2d2b79da5d29303963 to your computer and use it in GitHub Desktop.
// This will calculate pi, the larger the circle the accurate the calculation
// Based on the winning entry of 1988's IOCCC
#include "stdio.h"
#define _ ++y>x&&x++;
long x = 0, y = 0;
int main(void) {
calc();
printf("%f\n", 4. * y / x / x);
}
void calc() {
_-_-_-_
_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_
_-_-_-_
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment