News for hackers. Stuff that matters.
Re:Underscore Pi (2017) by igravious on Tuesday May 01, 2018 @07:32AM (#16966156)
In all its glory:

   #define _ -F<00||--F-OO--;
   int F=00,OO=00;main(){F_OO();printf("%1.3f\n",4.*-F/OO/OO);}F_OO()
   {
               _-_-_-_
          _-_-_-_-_-_-_-_-_
       _-_-_-_-_-_-_-_-_-_-_-_
     _-_-_-_-_-_-_-_-_-_-_-_-_-_
    _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
    _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
   _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
   _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
   _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
   _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
    _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
    _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
     _-_-_-_-_-_-_-_-_-_-_-_-_-_
       _-_-_-_-_-_-_-_-_-_-_-_
           _-_-_-_-_-_-_-_
               _-_-_-_
   }
Fierce! Unhinged! Cromulent! Kickass!
Re:Underscore Pi (2017) by saagarjha on Tuesday May 01, 2018 @03:34AM (#16965218)
Unfortunately, this doesn't seem to work in Clang because it doesn't support the -traditional-cpp flag. Make sure that you're actually using GCC if you're following along!
Re:Underscore Pi (2017) by jerrre on Tuesday May 01, 2018 @10:08AM (#16967120)
> What would happen if you make the circle in the code bigger?

More precision?

Re:Underscore Pi (2017) by swalladge on Tuesday May 01, 2018 @02:59AM (#16965057)
Re:Underscore Pi (2017) by dang on Tuesday May 01, 2018 @02:55AM (#16965051)
We changed the title from "Underscore Pi – when M_PI from math.h is too mainstream; IOCCC winning entry".

This is a fine HN submission, but please don't rewrite titles to editorialize!

https://news.ycombinator.com/newsguidelines.html

Re:Underscore Pi (2017) by LambdaComplex on Tuesday May 01, 2018 @09:54AM (#16967022)
Could you maybe add something about it being an IOCCC winner back in? (I generally read the comments first to decide if I want to read the article, and I wasn't going to bother reading this until I saw it had something to do with the IOCCC)
Re:Underscore Pi (2017) by quietbritishjim on Tuesday May 01, 2018 @02:28AM (#16964948)
M_PI is not part of the C standard (it is part of Posix) so the title is awkward.
Re:Underscore Pi (2017) by jgtrosh on Tuesday May 01, 2018 @02:53AM (#16965041)
I agree it's awkward, but not because of M_PI being non-standard. If history had lead to pi being defined in standard C, this code would still have been interesting. The title is awkward because it talks more about M_PI than about the content of the article.
Re:Underscore Pi (2017) by quietbritishjim on Tuesday May 01, 2018 @03:57AM (#16965293)
I agree that the code is interesting. It was specifically the HN title I was talking about, which is not even the title of the original article. Sorry if I wasn't clear. Anyway, it's been updated now.