Test integerness: Difference between revisions
→{{header|J}}: show fraction examples
(Added Sidef) |
(→{{header|J}}: show fraction examples) |
||
Line 1,267:
'''Solution''':<lang j> isInt =: (= <.) *. (= {.@+.)</lang>
'''Alternative solution''' (remainder after diving by 1?): <lang j> isInt=: (0 = 1&|) *. (0 = {:@+.)</lang>
'''Example''':<lang j> isInt 3.14 7 1.4j0 4j0 5j3 5r3 6r3
0 1 0 1 0 0 1</lang>
=={{header|Java}}==
|