Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - mrd

#1
newLISP newS /
September 24, 2004, 01:00:17 PM
Quote from: "Lutz"
People who do bignum application perhaps shouldn't use a scripting language like newLISP. Those bignum applications would probably involve heavy number-crunching which is more suited to do in a compiled language.


The best CL for bignums is actually CLISP, surprisingly.  It is a byte-code interpreter, but it uses extremely fast algorithms.  CMUCL does better with FP, though.  But CLISP has arbitrary-precision floats, which is unusual (you have to toggle something to get them though).


Quote from: "Lutz"
Perhaps a nice compromise would be to have bignum library written in 'C' and import it into newLISP which is more or less what David is suggesting. This library then could have other math stuff too, used by people dealing with bignums.


Then it won't automatically switch between fixnums and bignums.  This is extremely convenient.  Most other languages are moving towards this feature, not away.
#2
newLISP newS /
September 23, 2004, 12:53:31 PM
Quote from: "Lutz"He could have just defined it using floating point arithmetik:


Lutz, please be a little more sensible.  Do not abuse floating point arithmetic like this, it is causing us all to laugh at you.  Floating point arithmetic is for INEXACT CALCULATIONS ONLY.  Using floating point representation as a stand-in for real numbers is a classic newbie mistake.  Floating point has its uses, but none of them include representing arbitrary precision exact integers.   The correct solution is to implement proper bignum support just like every other Lisp.  While you're at it, do polymorphic arithmetic operations.  Having +, -, *, and / only work on machine-sized integers (and no rational type) is lame.





http://en.wikipedia.org/wiki/Floating-point">Wikipedia entry on Floating Point Arithmetic



http://docs.sun.com/source/806-3568/ncg_goldberg.html">What Every Computer Scientist Should Know About Floating Point Arithmetic