Open navdeepkjohal opened 1 month ago
Clingo does not support floats. It is possible to use them during grounding by using its API:
#script (python)
import math
from clingo.symbol import String
def sqrt(x):
return String(repr(math.sqrt(float(x.string))))
#end.
p(@sqrt("17.3")).
See also our list: https://sourceforge.net/p/potassco/mailman/potassco-users/thread/0d78fb1b0eef6ddd729a856c013b79d2037a8bd8.camel%40cs.uni-potsdam.de/#msg37606655
Edit: I believe there was a paper once about extending ASP with floats. Unfortunately, I don't remember the title.
Hello,
Can you please tell me if clingo supports floating -point numbers or not?
I have a fact that says "one batch has 1.5 gallons of coffee. ". I want to write it as batch_size_gallons(1.5). but clingo reads the decimal after 1 as a full stop and throws an error that says: