For the type data you show the solutions people have sent you are just
fine; however, if you have numbers that are within comparison tolerance
of an integer you might want to use
Whole=:<.(=#[)]
3!:3 Whole All,18.0000000000001
e1000000
04000000
06000000
01000000
06000000
04000000
08000000
09000000
0c000000
0f000000
12000000
It returns integer values where the other approaches return floats if
you have a number close to an integer in the list. This might be
slightly faster as well as it does not have to convert the final result
to integer.
David Vincent-Jones wrote:
I am looking for a simple way to eliminate fractional numbers from a list.
All=. 4, 5.6, 7.3, 8, 9, 9.2, 9.9, 12, 15
Whole 4 8 9 12 15
Currently I am comparing against a >. but that appears rather clumsy
David
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm