Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!bloom-beacon!eru!luth!sunic!sics.se!sics.se!roland From: roland@sics.se (Roland Karlsson) Newsgroups: comp.lang.prolog Subject: Re: Sicstus Prolog Questions Message-ID: <1990Jul24.111727.14354@sics.se> Date: 24 Jul 90 11:17:27 GMT References: <5574@uceng.UC.EDU> Sender: news@sics.se Organization: Swedish Institute of Computer Science, Kista Lines: 38 In-Reply-To: ranga@uceng.UC.EDU's message of 22 Jul 90 11:09:12 GMT > For example, here is a simple psuedo random number generator. > IX is the seed. This produced about 700 to 800 random numbers correctly > (I checked them through other means) and then started giving out 0's; > The reason, I found through tracing, invariably was an underflow/overlow. > At that point, the prolog system wouldn't do even simple arithmetic > properly: for eg, `A is 1/6' produces `A = 4.32583271660369e-308' !!! Yes there have been some bugs in previous versions of number crunching. This bug is no more. By the way, SICStus no longer use table lookup for numbers. Numbers are stored on the heap. > As one way of avoiding the above problem, I have tried to implementing > my floating point routines in C and tried to interface them using > the foreign language interface feature of Sisctus. I couldn't get > that working either. 'load_foreign_files' gives me either > an 'illegal usage' message or says 'myCfile.o undefined'. > 'foreign' and 'foreign_file' also give 'illegal usage' messages. As I not have seen your code it is impossible to tell why the foreign_interface do not work. It works for me. Maybe you have an old version of SICStus or maybe you are doing something wrong. Current version is: SICStus 0.6 #18: Wed Jul 11 20:00:53 MET DST 1990 Roland Karlsson PS. The best way to get answers concerning SICStus Prolog is to write to matsc@sics.se (Mats Carlsson). He is on vacation but will be back in a couple of weeks. He always answers promptly and is more than glad to know about bugs (:-). DS. -- Roland Karlsson SICS, PO Box 1263, S-164 28 KISTA, SWEDEN Internet: roland@sics.se Tel: +46 8 752 15 40 Ttx: 812 61 54 SICS S Fax: +46 8 751 72 30