Record Case Detail

Notes

This function is in beta test. Please help improve it in the issues here.

Stderr

/in/mySqrt.c:14:13: runtime error: index 100 out of bounds for type 'double [100]'
/in/mySqrt.c:14:13: runtime error: load of address 0x7ffdca7e2650 with insufficient space for an object of type 'double'
0x7ffdca7e2650: note: pointer points here
 68 b7 0c 3f  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 cd a9 96 ef 55 00 00  01 00 00 00
              ^ 
=================================================================
==46497==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffdca7e2650 at pc 0x55ef9689bbcb bp 0x7ffdca7e2250 sp 0x7ffdca7e2240
READ of size 8 at 0x7ffdca7e2650 thread T0
    #0 0x55ef9689bbca in main (/out/package/mySqrt+0x1bca)
    #1 0x7f8f598fab96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #2 0x55ef9689c699 in _start (/out/package/mySqrt+0x2699)

Address 0x7ffdca7e2650 is located in stack of thread T0 at offset 896 in frame
    #0 0x55ef9689b68f in main (/out/package/mySqrt+0x168f)

  This frame has 2 object(s):
    [32, 40) 'b'
    [96, 896) 'y' <=

Hints

Your answer may be identical to the JOJ answer in the first several lines.

However, the main problem you meet now is Runtime Error. And the exit code of your program is 1, which should be 0.

Please double check your code to solve this problem and try again.

Your Answer


        

JOJ Answer

0.0001