Mercurial > octave-antonio
comparison scripts/specfun/realsqrt.m @ 11587:c792872f8942
all script files: untabify and strip trailing whitespace
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Jan 2011 17:35:29 -0500 |
parents | fd0a3ac60b0e |
children | 72c96de7a403 |
comparison
equal
deleted
inserted
replaced
11586:12df7854fa7c | 11587:c792872f8942 |
---|---|
26 function y = realsqrt (x) | 26 function y = realsqrt (x) |
27 if (nargin != 1) | 27 if (nargin != 1) |
28 print_usage (); | 28 print_usage (); |
29 elseif (iscomplex (x) || any (x(:) < 0)) | 29 elseif (iscomplex (x) || any (x(:) < 0)) |
30 error ("realsqrt: produced complex result"); | 30 error ("realsqrt: produced complex result"); |
31 else | 31 else |
32 y = sqrt (x); | 32 y = sqrt (x); |
33 endif | 33 endif |
34 endfunction | 34 endfunction |
35 | 35 |
36 %!assert (sqrt(1:5),realsqrt(1:5)) | 36 %!assert (sqrt(1:5),realsqrt(1:5)) |