[plt-scheme] off (plt) topic (short koan in .c language and a question)
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)