Re: [eclipse-clp-users] Managing lists of real variable

From: Kish Shen <kisshen_at_...5...>
Date: Wed, 14 Oct 2009 17:54:31 +0100
simone pascucci wrote:
> conversion if they want to pass the result to java (I suppose I should cast
> the breals to float), but I'm experiencing a infinite loop (or at least
> something like that). This happen for example if I add at the very end the
> following
> 
>        locate(Variables, 1e-5),
>        float(Amount).
> 
float(Amount) does not convert a number into a float -- it is a test for 
a float, and I assume in your case, it fails because you have a bounded 
real, so it fails back into the locate/2 labelling.

You should check the documentation when you are using a built-in you are 
not familiar with -- ECLiPSe allows you to do this easily from the 
top-level, you simply have to type help <predicate spec>, in your case,
help float/1. Als0, since variables in ECLiPSe cannot be destructively 
assigned, there is no way you can perform a conversion with a predicate 
with only one argument.

To convert a number into a float, you need to use float/2 (see the 
documentation).

Cheers,

Kish


-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.
Received on Wed Oct 14 2009 - 16:54:43 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST