RosettaCodeData/Task/Detect-division-by-zero/Octave/detect-division-by-zero.octave
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

6 lines
121 B
Text

d = 5/0;
if ( isinf(d) )
if ( index(lastwarn(), "division by zero") > 0 )
error("division by zero")
endif
endif