Article View: comp.lang.prolog
Article #628Re: fuzzy unification of floating point numbers
From: Jonny Farringdon
Date: Thu, 13 Aug 1992 13:39
Date: Thu, 13 Aug 1992 13:39
31 lines
1105 bytes
1105 bytes
>Does anybody know the prolog for UNIX which supports
>the fuzzy unification of floating point numbers,
>that is two floating point numbers are considered
>equal if | X - Y | =< FUZZVALUE and this FUZZVALUE
>can be changed by user? I know that VM/Prolog has
>this feature, but it works on mainframe.
>Any information is appreciated.
Mike,
each time you want to do
thing(A,B) :-
a = b,
important_thing.
do:
thing(A,B) :-
fuzzy_equality_test(A,B),
important_thing.
fuzzy_equality_test(A,B) :-
fuzzy_unify_value(V), !,
Diff is A - B,
absolute_value(Diff,Abs_Diff),
Abs_Diff < V.
fuzzy_equality_test(A,A) :- !.
J. ucjtrjf@ucl.ac.uk
Technical Details
Message-ID:
<1992Aug13.133930.25900@bas-a.bcc.ac.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!bcc.ac.uk!link-1.ts.bcc.ac.uk!ucjtrjfReferences:
<1992Aug12.210954.15241@cs.ucla.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!bcc.ac.uk!link-1.ts.bcc.ac.uk!ucjtrjf From: ucjtrjf@ucl.ac.uk (Jonny Farringdon) Newsgroups: comp.lang.prolog Subject: Re: fuzzy unification of floating point numbers Message-ID: <1992Aug13.133930.25900@bas-a.bcc.ac.uk> Date: 13 Aug 92 13:39:30 GMT References: <1992Aug12.210954.15241@cs.ucla.edu> Organization: Bloomsbury Computing Consortium Lines: 31