开发者

How to convert integer to decimal point in PROLOG?

开发者 https://www.devze.com 2023-04-07 10:00 出处:网络
How to convert integ开发者_高级运维er to decimal point in PROLOG? Example, imagine I assign Integer = 10

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号