Skip to content
Prev 350923 / 398502 Next

Determinant

On May 14, 2015, at 1:44 AM, chasiotisv at math.auth.gr wrote:

            
The square of 1.677722e+29 is almost certainly an integer since the power of 10  (+29)  exceeds the number of digits. That implies that the number in non-scientific notation has many 0's on the righthand side.

I'm guessing that you may be asking whether the square-root is an integer.
Again guessing that by 'radical' you mean the square-root. I am also confused about  what test you were applying to that result to determine that it was not an integer. 

At any rate, I'm guessing that the limitation of R's numerical accuracy may get in the way of determining whether the square-root is an integer. If it were integer then it should equal floor(n) :

 (1.6777215999999849e+29)^(1/2) - floor((1.6777215999999849e+29)^(1/2)) 
#[1] 0.125

 (1.6777216e+29)^(1/2) - floor( (1.6777216e+29)^(1/2) )
#[1] 0

That's because that number was the product of two perfect squares:
[1] 4095

And 10^22 = 10^11*10^11


If you know how big the  original was you could round it to the correct precision but that seems too much to hope for.

 print( round(1.6777215999999849e+29, digits=10) , digits=10)
#[1] 1.6777216e+29

identical( (1.6777216e+29)^(1/2) , floor( (1.6777216e+29)^(1/2) ) )
#[1] TRUE
There are a couple of packages that support exact math on really large numbers. You need to clarify what is being requested. You definitely need to review R-FAQ 7.31 and make sure you understand it and also review ?double and ?integer