Talk:Arbitrary-precision integers (included): Difference between revisions

Content added Content deleted
m (→‎Use of external libraries: Later comment moved to end of section.)
Line 1: Line 1:
==Use of external libraries==
==Use of external libraries==

Interestingly, because the fixed const value is needed, the perfect solution may be just one liner hardcoded ''print("62060698786608744707 ... 92256259918212890625")''. And the "bad" solution is any implementation of Muḥammad ibn Mūsā al-Khwārizmī algorithms.

'''The task has is not well-defined.''' Different programming languages are different. Some are monolithic (such as Pascal). Others are modular by design.

Therefore, the task should be modified. It should be allowed to use external libraries (from generally available repositories such as PyPI, CPAN etc.) - and '''when there is no arbitrary arythmetic''' in such standard libraries then showing how the goal can be achieved using standard language mechanisms. Standard mechanisms '''should be understood as ''write functions, procedures, classes, etc., to perform what is necessary.'''''

Anyone seeing the source code will be able to '''judge for themselves''' how convenient a given language is for this type of calculation. --[[User:Anonymous31415927|Anonymous31415927]] ([[User talk:Anonymous31415927|talk]]) 11:49, 12 September 2020 (UTC)




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. --[[User:Short Circuit|Michael Mol]] 08:33, 13 February 2010 (UTC)
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. --[[User:Short Circuit|Michael Mol]] 08:33, 13 February 2010 (UTC)
Line 42: Line 32:
:::As for organising another task with or without this or that, I leave that to others as already, many flowers bloom and I wander without guide. There does not seem to be a facility for grouping related tasks, or multiple parts of a larger task, or even cross-referencing tasks. Just a flat list of tasks ordered alphabetically and with not always helpful choices of the first word. A tree-structure? But the A.B.etc, B.X.etc ordering won't work when it is not clear which should be the first-level keywords. This is a matter for the design of RC's presentation, which I know little about, and I see a lot of scope for disagreement. [[User:Dinosaur|Dinosaur]] ([[User talk:Dinosaur|talk]]) 07:09, 14 November 2016 (UTC)
:::As for organising another task with or without this or that, I leave that to others as already, many flowers bloom and I wander without guide. There does not seem to be a facility for grouping related tasks, or multiple parts of a larger task, or even cross-referencing tasks. Just a flat list of tasks ordered alphabetically and with not always helpful choices of the first word. A tree-structure? But the A.B.etc, B.X.etc ordering won't work when it is not clear which should be the first-level keywords. This is a matter for the design of RC's presentation, which I know little about, and I see a lot of scope for disagreement. [[User:Dinosaur|Dinosaur]] ([[User talk:Dinosaur|talk]]) 07:09, 14 November 2016 (UTC)
::::Just for fun: even languages with builtin multiprecision may have additional libraries, for good reasons. For instance, Python has big integers, but the gmpy2 library is linked to GMP, which is way faster than the standard Python integers (plus it also adds multiprecision floats, which are not in the base Python distribution). It makes very little sense to only allow what is included in the bare language: who programs in C++ without BOOST? Who programs in Fortran without LAPACK? Who programs in Lisp without ASDF or even QuickLisp and a bunch of libraries? Who programs, in any language, a GUI without a GUI library? (rarely included, and even when it is, it's never the only one) It's a basic fact of programming that one should not reinvent the wheol but reuse, hence it would be perfectly correct to link to an external library. That's how it ''should'' be done in real life. But, bitter truth, this is not the present task. I'll write another one, maybe. This is really silly. Feel free to quibble about what Fortran could have been sixty years ago, it's almost as useless as the rest of the task! [[User:Arbautjc|Arbautjc]] ([[User talk:Arbautjc|talk]]) 18:07, 14 November 2016 (UTC)
::::Just for fun: even languages with builtin multiprecision may have additional libraries, for good reasons. For instance, Python has big integers, but the gmpy2 library is linked to GMP, which is way faster than the standard Python integers (plus it also adds multiprecision floats, which are not in the base Python distribution). It makes very little sense to only allow what is included in the bare language: who programs in C++ without BOOST? Who programs in Fortran without LAPACK? Who programs in Lisp without ASDF or even QuickLisp and a bunch of libraries? Who programs, in any language, a GUI without a GUI library? (rarely included, and even when it is, it's never the only one) It's a basic fact of programming that one should not reinvent the wheol but reuse, hence it would be perfectly correct to link to an external library. That's how it ''should'' be done in real life. But, bitter truth, this is not the present task. I'll write another one, maybe. This is really silly. Feel free to quibble about what Fortran could have been sixty years ago, it's almost as useless as the rest of the task! [[User:Arbautjc|Arbautjc]] ([[User talk:Arbautjc|talk]]) 18:07, 14 November 2016 (UTC)


Interestingly, because the fixed const value is needed, the perfect solution may be just one liner hardcoded ''print("62060698786608744707 ... 92256259918212890625")''. And the "bad" solution is any implementation of Muḥammad ibn Mūsā al-Khwārizmī algorithms.

'''The task has is not well-defined.''' Different programming languages are different. Some are monolithic (such as Pascal). Others are modular by design.

Therefore, the task should be modified. It should be allowed to use external libraries (from generally available repositories such as PyPI, CPAN etc.) - and '''when there is no arbitrary arythmetic''' in such standard libraries then showing how the goal can be achieved using standard language mechanisms. Standard mechanisms '''should be understood as ''write functions, procedures, classes, etc., to perform what is necessary.'''''

Anyone seeing the source code will be able to '''judge for themselves''' how convenient a given language is for this type of calculation. --[[User:Anonymous31415927|Anonymous31415927]] ([[User talk:Anonymous31415927|talk]]) 11:49, 12 September 2020 (UTC)


== Criteria for Non-Draft? ==
== Criteria for Non-Draft? ==