Re: Float constants in Eclipse

From: Joachim Schimpf <j.schimpf_at_icparc.ic.ac.uk>
Date: Wed 12 Jan 2005 11:38:24 AM GMT
Message-ID: <41E50C30.8050703@icparc.ic.ac.uk>
Huy wrote:
> Hi everyone,
> 
> I would like to ask how I could write atomic
> statements like:
> 
> myVector3D(0.123, 1.234, 3.456).

As Andy already said, it is not clear what you are asking.
If you are new to Prolog/Eclipse, you should read chapters 3 and 4
of the Eclipse Tutorial.  These will explain some terminology (for
example, we never talk about 'statements' in logic programming),
the data types, the difference between program and data, etc.
Hopefully, this will either answer your question directly, or help
you to ask a more precise one!

If your question is about how to represent a vector, then the answer
would be, either as a list like [0.123, 1.234, 3.456], or as a structure
like vector(0.123, 1.234, 3.456). Lists may be more convenient because
you can use them directly in certain arithmetic operations, e.g.

?- Vector = [0.123, 1.234, 3.456], S is sum(Vector).
Vector = [0.123, 1.234, 3.456]
S = 4.813
Yes (0.00s cpu)


-- 
  Joachim Schimpf              /             phone: +44 20 7594 8187
  IC-Parc                     /      mailto:J.Schimpf@imperial.ac.uk
  Imperial College London    /    http://www.icparc.ic.ac.uk/eclipse
Received on Wed Jan 12 11:40:13 2005

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:33 PM GMT GMT