🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #1073

Fun With Floats in Quintus

#1073
From: Eric Iverson
Date: Mon, 13 Aug 1990 23:44
57 lines
1507 bytes
How oh how does one represent the numbers 8.1 and 5.4 in Quintus
Prolog?  I have tried everything I can think of without any luck.
Below are a few of my attempts:
----------------------------------------------------------------------------
Quintus Prolog Release 2.5.1 (Sun-4, SunOS 4.1)

| ?- X is 8.1.

X = 8.09999

| ?- X is 5.4.

X = 5.39999 

| ?- number_chars(8.1,X),number_chars(Y,X).

X = [56,46,48,57,57,57,57],
Y = 8.09998 

| ?- number_chars(5.4,X),number_chars(Y,X).

X = [53,46,51,57,57,57,57],
Y = 5.39999 

| ?- X is 8.1+0.00001.

X = 8.09999 

| ?- X is 8.1+0.00002.

X = 8.10001 

| ?- X is 8.09999+0.00001.

X = 8.09998

| ?- X is 8.09999+0.00002.

X = 8.09999 

| ?- X is 8.09999+0.00003.

X = 8.09999 

| ?- X is 8.09999+0.00004.

X = 8.10001 

--
------------------------------------------------------------------------
Eric Iverson				Internet: eiverson@nmsu.edu
Computing Research Lab
Box 30001/3CRL				Life is something to do when
New Mexico State University		you can't get to sleep.
Las Cruces, NM 88003-0001			-Fran Lebowitz
(505) 646-5711
Technical Details
Message-ID: <EIVERSON.90Aug13174424@aigyptos.nmsu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!lanl!nmsu!opus!eiverson

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!lanl!nmsu!opus!eiverson
From: eiverson@nmsu.edu (Eric Iverson)
Newsgroups: comp.lang.prolog
Subject: Fun With Floats in Quintus
Message-ID: <EIVERSON.90Aug13174424@aigyptos.nmsu.edu>
Date: 13 Aug 90 23:44:24 GMT
Sender: news@NMSU.Edu
Distribution: comp
Organization: NMSU Computer Science
Lines: 57