BINARYIO - Binary Input and Output
Your task is to compute natural logarithm for real parameter X with absolute or relative error less than 10-12.
10-12 ≤ X ≤ 1012. There will be up to 1,000,000 numbers in array.
For each number in input you should output the corresponding answer.
Input: 1 10 Output: 0 2.3025850929940456840179914546844
Note: Sample input and output are readable for your convenience!!!
Arrays in memory and in input are byte-to-byte identical.
To read double a use fread(&a, sizeof(a), 1, stdin) instead of scanf("%lf", &a) until the end of file.
To write double a use fwrite(&a, sizeof(a), 1, stdout) instead of printf("%lf\n", a).
I tried both methods to read (whole input, or double by double)... It works at home... Any clue for WA here ? Thanks.
Ohhh, no bit strings at all, now I understand.
I haven't done extensive bugtesting, but the question is a little unclear because it does not specify bit order; I'm using Wikipedia convention: