From tob@world.std.com Tue May 22 23:36:12 2001
Received: from localhost.std.com (ppp0b173.std.com [208.192.101.173])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f4MLaA317763
	for <prolog@swi.psy.uva.nl>; Tue, 22 May 2001 23:36:10 +0200 (MET DST)
Received: (from Tehom@localhost)
	by localhost.std.com (8.9.3/8.9.3) id RAA00839;
	Tue, 22 May 2001 17:32:23 -0400
X-Authentication-Warning: localhost.std.com: Tehom set sender to tob@world.std.com using -f
To: =?iso-8859-1?q?Jo=E3o?= Mariz <joao.mariz@mail.ineti.pt>
Cc: Swi-PROLOG usergroup <prolog@swi.psy.uva.nl>
Subject: Re: [SWIPL] How to convert atoms to reals
References: <3B0A965D.BB28EA0D@mail.ineti.pt>
From: Tom Breton <tob@world.std.com>
Date: 22 May 2001 13:29:53 -0400
In-Reply-To: =?iso-8859-1?q?Jo=E3o?= Mariz's message of "Tue, 22 May 2001 17:39:57 +0100"
Message-ID: <m3zoc5z3zi.fsf@world.std.com>
User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.4
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Lines: 29

Joćo Mariz <joao.mariz@mail.ineti.pt> writes:

> Hello SWI-Prolog users,
> 
> I am sorry for taking your time with such simple questions.
> 
> However, I am trying to convert code from another prolog interpreter,
> and I am still a newbie in SwiProlog and xpce. Althought I spend several
> hours searching in the users guide for predicates that could resolve me
> this question and I did not succeed.
> 
> So please tell me how can I convert from an atom to a real to preform
> later some calculations? Or where can I find this answers in the Users
> Guide.

In the SWI manual, "3.20 Analysing and Constructing Atoms",
atom_to_term does that.  I don't know how that interacts with XPCE,
tho.

1 ?- atom_to_term('12.3', My_real, _), A is My_real + 1.0.

My_real = 12.3
A = 13.3 


Yes

-- 
Tom Breton, http://world.std.com/~tob

