Test integerness: Difference between revisions
Content added Content deleted
(removing extra-credit and making it a task requirement) |
(mark a few solutions as incomplete as the task has changed) |
||
Line 7: | Line 7: | ||
=={{header|J}}== |
=={{header|J}}== |
||
{{incomplete}} |
|||
<lang J>(= <.) 3.14 7</lang> |
<lang J>(= <.) 3.14 7</lang> |
||
{{out}} |
{{out}} |
||
Line 22: | Line 23: | ||
=={{header|Python}}== |
=={{header|Python}}== |
||
{{incomplete}} |
|||
<lang python>>>> def isint(f): |
<lang python>>>> def isint(f): |
||
return int(f) == f |
return int(f) == f |
||
Line 32: | Line 34: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
{{incomplete}} |
|||
{{incorrect|REXX|Can be zero and negative}} |
|||
<lang rexx>/* REXX --------------------------------------------------------------- |
<lang rexx>/* REXX --------------------------------------------------------------- |
||
* 20.06.2014 Walter Pachl |
* 20.06.2014 Walter Pachl |
||
Line 80: | Line 82: | ||
=={{header|Tcl}}== |
=={{header|Tcl}}== |
||
{{incomplete}} |
|||
The simplest method of doing this is testing whether the value is equal to the value after casting it to a integral value. |
The simplest method of doing this is testing whether the value is equal to the value after casting it to a integral value. |
||
<lang tcl>proc isNumberIntegral {x} { |
<lang tcl>proc isNumberIntegral {x} { |