Talk:Long multiplication: Difference between revisions

 
(12 intermediate revisions by 5 users not shown)
Line 40:
* Bracmat, calls operator *
* C++, calls operator * of cln::cl_I
* <del>C#, calls Multiply of System.Numerics.BigInteger</del>
* D (1st example), calls operator * of BigInt from std.bigint
* F#, calls operator *
Line 57:
* Seed7, calls operator *
* Slate, calls operator *
* <del>Smalltalk, calls operator *</del> (changed: now shows both)
 
For these examples, I would like some assurance that the outside algorithm really is long multiplication, and not some other algorithm (such as Karatsuba or Toom multiplication). Examples that use the wrong algorithm are incorrect. Further, I would like to clarify the task, to prohibit the use of outside algorithms, unless those algorithms do long multiplication. I think that [[Arbitrary-precision integers (included)]] is a better place to call outside algorithms. --[[User:Kernigh|Kernigh]] 00:36, 20 March 2012 (UTC)
Line 82:
::::So far, I implement the most interesting solution, which is not always the shortest solution. <i>Sometimes</i> I implement both as the generalised code versus the one-off code when such a comparison is useful/interesting/informative.
:::: [[User:NevilleDNZ|NevilleDNZ]] ([[User talk:NevilleDNZ|talk]])
::::: Perhaps the task should be defined in two parts - one to represent the intermediate results, the other to go from the intermediate results to the final results? --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 15:18, 13 May 2013 (UTC)
::: I do not really see a point in asking for the code in languages where arbitrary precision is already builtin. For one, it should not lead newcomers of a language to do it that way. And second, as the builtin operators are usually highly tuned to the task, which a naive piece of code usually is not. ALsoAlso, I found other languages, where it seemed perfectly ok to write a comment like "is native in language" (sidef) or even a call to BigInt arithmetic (D), so I think that should be also ok for languages like scheme, self, smalltalk etc. And b.t.w. what about languages which support an int128int256 type (eg native limited. but higher precision integer type). Are those allowed to use it or not? As I understood rosetta, it should give programmers a feel of how the language is used, not how its builtin operators are implemented. --[[User:Cg|Cg]] ([[User talk:Cg|talk]])
:::: Are you saying that newcomers to a language should not use the builtins? (Also, please sign your comments - you inserted your comment in front of my signature which might have been misleading.) --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 1522:1819, 1326 MayOctober 20132015 (UTC)
::::: No, "to do it that way" referred "to reinventing and write your own (possibly suboptimal) multiply". And sorry for the edit mistake, and for the late reply (long time - no time).--[[User:Cg|Cg]] ([[User talk:Cg|talk]])
 
== PLI Fails for me ==
Line 100 ⟶ 101:
==negative numbers==
 
Most of the programming examples don't appear to handle &nbsp; ''negative'' &nbsp; numbers. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 20:25, 25 July 2015 (UTC)
 
==integers or numbers?==
Also, itIt doesn't specifically mention that only integers are to be used &nbsp; (although it did mention that &nbsp; ''one possible approach to arbitrary-precision integer algebra''). &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 20:25, 25 July 2015 (UTC)
 
==verify against builtin==
I've added an optional verify against builtin clause to the task description, as most implementations seem to adhere to the spirit of the task and explicitly implement longhand multiplication. However, seven entries do not, being Crystal, Icon, OI, Prolog, Slate, XPL0, and zkl. I am inclined to mark (and in the case of Slate, re-mark) those as incorrect. I would also suggest this task be renamed from "long" to "longhand". --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 13:35, 8 December 2020 (UTC)
Anonymous user