How to convert integer to decimal point in PROLOG?
How to convert integ开发者_高级运维er to decimal point in PROLOG? Example, imagine I assign Integer = 10 How do I change integer's value to turn to 1.0 (1 decimal point) ?
It's not an assignment but Integer is unified with 10 and can't be changed thereafter.
You could write Integer2 is 1.0 * Integer
or Integer2 is float(Integer)
at least in some Prolog implementations.
精彩评论