Hello everyone,
how can I eventually remove a fraction from a list?
p.ex. I want to remove all fractions from this list (7 8 9 28/3 21/2 12 14 16 18 56/3 21 24 27 28 63/2 32 35 36 112/3 40 42 45 140/3 48 49 105/2 54 56 60 63 64 196/3 70 72 147/2 224/3 77 80 81 84).
I tried to check out the integer lisp function but seems that doesn’t exist.
Thank you in advance!!
Hello
Do you wan to remove the fraction or convert them to floats ?
If you just want to remove them, you can test integers with INTEGERP and/or fractions with RATIOP
Yes like Jean said, if you want to erase
them, try remove-if function and type
#'ratiop in the test input.
If you want to convert to float,
I think you can just use OM+
to add every element with 0.0 (not 0!)
I think this only should change the type.
Or mapcar float maybe? I’m outside i can’t check.
Don’t know which one is lighter
parfait!
ça marche avec INTEGERP.
merci pour ta réactivité Jean!
@julien