ForNext
Only Do What Only You Can Do
039. sqrt -2
Hyperpolyglot Interpreted Languages: PHP, Perl, Python, Ruby より (2012.05.08)
VBScript
JScript
Perl
error unless use Math::Complex in effect
PHP
NaN
Python
# raises ValueError: import math math.sqrt(-2) # returns complex float: import cmath cmath.sqrt(-2)
Ruby
raises Errno::EDOM