Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (18 sloc) 0.442 kB
#!/usr/bin/perl
# Copyright 2004-2012, Paul Johnson (paul@pjcj.net)
# This software is free. It is licensed under the same terms as Perl itself.
# The latest version of this software should be available from my homepage:
# http://www.pjcj.net
use strict;
use warnings;
sub my_sqrt
{
my $n = shift;
if ( !defined($n) || ($n < 0) ) {
return undef;
}
return sqrt($n);
}
my_sqrt(25);
my_sqrt(-2);
my_sqrt(undef);
Jump to Line
Something went wrong with that request. Please try again.