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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -