Weird behavior of sqrt() function

Правка en1, от euler1, 2019-09-20 08:49:18

I participated in a recent contest, wherein I submitted this solution for the Multiplication table problem.

My solution passed the pretests but failed on a TC in system testing. In the failed TC, I was printing the square root of a perfect square and it was printed as 1e9 instead of 1000000000.

The square root function was not printing in scientific notation for smaller numbers, but it did for sqrt(1e18) i.e. 1e9. Does anyone know why this happened?

Теги sqrt

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский euler1 2019-09-20 08:49:18 600 Initial revision (published)