[plt-scheme] off (plt) topic (short koan in .c language and a question)

From: Todd O'Bryan (toddobryan at gmail.com)
Date: Sat May 8 08:31:45 EDT 2010

I think you're talking about this xkcd comic about the Collatz Conjecture:

http://www.xkcd.com/710/

Todd

On Thu, May 6, 2010 at 5:54 PM, Vladimir Konrad <vladimir at ok2home.net> wrote:
>
> Hello,
>
> Short koan in c language (tested on 64 bit platform, and 32 bit platform
> with gcc), just run:
>
> gcc short-what-is-what.c
>
> and then run:
>
> ./a.out
>
>
> /* copyright owned by every programmer - no rights reserved ;-) */
>
> #include <stdlib.h>
> #include <stdio.h>
>
> int main(int argc, char **argv) {
>
>  void* chunk;
>  const int number = 1234567890;
>  int i;
>  float f;
>
>  chunk = calloc(sizeof(int), 1);
>
>  if( chunk == NULL ) {
>    printf("cannot allocate\n");
>    return 1;
>  }
>  else {
>    *(int *) chunk = number;
>    f = *(float *) chunk;
>    i = *(int *) chunk;
>    printf("%i\t%f\n", i, f);
>  }
>
>  return 0;
>
> }
>
> /* eof */
>
> Now the question, a while ago I found a math conjecture (it is a joke one)
> and it is also a graph. It goes along the lines:
>
> if you start with odd number add 1 and divide by two and repeat this
> for very long time, your friends stop asking you out...
>
> Would you please point me to the source of this one (if you know)?
>
> I spent long time searching for it, but cannot find it (the source also
> had the picture of the graph).
>
> Kind regards,
>
> Vladimir
>
> --
>
> Just because you have intelligence like a hammer,
> you do not have to treat everyone else like a nail...
>
>    -- Principia Discordia (one of the versions)
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.