Talk:Arbitrary-precision integers (included)

From Rosetta Code
Revision as of 16:38, 13 February 2010 by MikeMol (talk | contribs) (→‎Use of external libraries: Least effort and idiomatic solutions.)

Use of external libraries

I strongly recommend allowing the use of external libraries in the case where the language doesn't have inherent bignum support. Otherwise, you would need a more generalized task, and I don't see a point to the example code duplication that would require. --Michael Mol 08:33, 13 February 2010 (UTC)

Hi Michael, I am trying to distinguish between the use of a library that is associated with the language versus one that is generic. It is a grey area because, for example, CPAN does wrap GNU MP which would make it fine as you would assume that the average Perl user would have no problem installing the CPAN module. But what of some other language with a generic interface to C/C++ that needs a generic download of the GNU MP source, compiled, then loaded with a generic inter-language call capability? I am trying to exclude this latter case as we already have an entry for calling other languages and I would like this task to not degenerate into showing how half the languages can link to GNU MP.
Another grey area might be languages where the norm is to use libraries from a another language that it is very close to. All the .Net languages might use a standard Bignum implemented in C#; or JVM languages use the standard Java Bignum. In these cases, where the languages regularly and normally share 'standard' libraries, then I think they should go ahead and use it. --Paddy3118 09:14, 13 February 2010 (UTC)
I guess I'm trying to make the '... (included)' tasks show more of what comes with very little effort, and is known to work, with the language itself. --Paddy3118 09:23, 13 February 2010 (UTC)
So, you're looking for what people can do within the language or with a very common add-on library? (In some languages, it's normal and expected to be using extra libraries for things, and so the core language itself has very little functionality.) –Donal Fellows 11:49, 13 February 2010 (UTC)
Just because the mechanism behind a task is already shown somewhere else doesn't mean we shouldn't allow the usage of that mechanism to solve a different problem. If we were to generalize that as a rule, most of the tasks on Rosetta Code would be defunct because we have tasks for looping and flow control. By their very nature, people tend to go with least-effort solutions, and for any given language, the least-effort solution to an expert will be idiomatic for that language. If a language has good support for arbitrary precision, an expert in that language is likely to use the native support. If the language has poor support, the expert in that language will prefer to pull in an outside library. --Michael Mol 16:38, 13 February 2010 (UTC)

I was rather hoping people would demonstrate how to write an arbitrary-precision / bignum library, in their preferred language, from scratch. I've been scribbling ideas on the train / bus to and from work. Um, err, yes ... in VBScript. Of course, it wouldn't necessarily be very efficient in that language, but, once working, it might be better in VB6 ... --Axtens 13:31, 13 February 2010 (UTC)

Hi Axtens, You could write a task to, say, compute the same number using only, say, 16 bit integers, but I think a full-blown Bignum implementation would become too large to compare implementations? I did the easy one ;-)
--Paddy3118 16:21, 13 February 2010 (UTC)
You might find Long multiplication interesting. Also, I'm almost certain I created a long division task, but I don't see it anywhere. A better way to ask for what you're looking for might be to ask for implementations of particular algorithms. I don't know the names of many relevant algorithms off-hand, though; perhaps some of the CS majors could chime in. --Michael Mol 16:28, 13 February 2010 (UTC)

Criteria for Non-Draft?

What are the criteria for making this page a full task? There are already a number of implementations and the task itself is largely clear too. –Donal Fellows 11:51, 13 February 2010 (UTC)

“Precision”

Is the use of “precision” appropriate? To me, “precision” suggests fractional digits (to the right of the decimal[-or-binary] point). —Kevin Reid 12:55, 13 February 2010 (UTC)