Detect division by zero: Difference between revisions
Content added Content deleted
Jazzedpineda (talk | contribs) (Add Plain English) |
|||
Line 1,826: | Line 1,826: | ||
<syntaxhighlight lang="pl/sql">divide(0,1) --false |
<syntaxhighlight lang="pl/sql">divide(0,1) --false |
||
divide(1,0) --true, division by zero</syntaxhighlight> |
divide(1,0) --true, division by zero</syntaxhighlight> |
||
=={{header|Plain English}}== |
|||
{{libheader|Plain English-output}} |
|||
When dividing by zero in Plain English, it explicitly returns 2147483647. The decider below detects division by zero by checking if it returns 2147483647. |
|||
<syntaxhighlight lang="text"> |
|||
To run: |
|||
Start up. |
|||
If 1 and 0 does cause division error, write "Division by zero found" to the output. |
|||
Wait for the escape key. |
|||
Shut down. |
|||
To decide if a number and another number does cause division error: |
|||
Put the number divided by the other number into a third number. |
|||
If the third number is the largest number, say yes. |
|||
Say no. |
|||
</syntaxhighlight> |
|||
=={{header|PowerShell}}== |
=={{header|PowerShell}}== |