How to get int from float in picat? -
i try to read line string console (stdin) in picat , half:
main => l = read_line(), b = l.length/2, s = l.slice(1,b), println(s).
crashes error(integer_expected(2.0),slice)
when int used instead of b - no crash. how turn b integer?
try either using integer(..)
function convert l.length/2
integer or use to_integer()
function....should you.
Comments
Post a Comment