in reply to sqrt string?
in thread Static typing is mostly a waste of time

Interesting. It seems to be taking the square root of MAXINT (2**32 on my platform), with some floating-point storage error in the answer.

While lacking strong typing might be detrimental in practical programs, it sure is fun to play with sometimes :)

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Replies are listed 'Best First'.
Re^2: sqrt string?
by Anonymous Monk on Apr 12, 2005 at 16:14 UTC
    You sure its not taking the sqrt of the memory address of the array?
    $a = $b = ["abc",123]; print "\$a is $a\n"; $a =~ s/\D+//; print "The decimal value of the address of the array is ",hex($a); print "\n"; print sqrt(hex($a)),"==", sqrt($b),"\n";

      Ahh, yes. That is it.

      "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.