Test integerness: Difference between revisions
Content added Content deleted
No edit summary |
(→{{header|J}}: adding input and output) |
||
Line 4: | Line 4: | ||
=={{header|J}}== |
=={{header|J}}== |
||
<lang J>= <.</lang> |
<lang J>(= <.) 3.14 7</lang> |
||
{{out}} |
|||
<pre>0 1</pre> |
|||
=={{header|Perl 6}}== |
=={{header|Perl 6}}== |
Revision as of 11:11, 18 June 2014
Test integerness is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.
Given a real numeric value, test whether or not it is an integer.
J
<lang J>(= <.) 3.14 7</lang>
- Output:
0 1
Perl 6
<lang perl6>say pi.narrow ~~ Int; say 1e5.narrow ~~ Int;</lang>
- Output:
False True