Talk:Integer roots

From Rosetta Code
Revision as of 11:26, 12 May 2016 by Rdm (talk | contribs) (Undo revision 227754 by Rdm (talk))

as a test...

Does     As a test, you can calculate ···     to be taken literally, or should it be inferred that it   is   to be the test?   The underscoring was added by me.   -- Gerard Schildberger (talk) 01:47, 11 May 2016 (UTC)

Do you mean the test is the algorithm to be used, or just a suggestion that that's the method   (or a method)   to be used?   -- Gerard Schildberger (talk) 01:47, 11 May 2016 (UTC)

Perhaps this is misleading. It certainly should not be the only test.

How should entries handle the case of a   zero   root?   -- Gerard Schildberger (talk) 01:47, 11 May 2016 (UTC)

Uncertain about that - ideas?
If you change the task's requirements that the root be a positive integer, that kills two birds with one stone.   -- Gerard Schildberger (talk) 02:37, 11 May 2016 (UTC)


In the task's requirements, it's mentioned that   N   is an integer.   If   N   is negative, it means that the resultant root is the reciprocal of the   abs(N)th   root.   Is this the intent of the task?   -- Gerard Schildberger (talk) 01:56, 11 May 2016 (UTC)

I would change that to "non-negative integer".

In the interim, for the REXX computer language entry, I used a general-purpose integer root (of any number) which bypasses the problem of multiplying a number by a gihugeic number to get around the problems with handling a decimal fraction.   The numbers being passed to the   iRoot   function could mimic the suggested method if required.

The REXX entry also handles negative roots, which are allowed by the current task requirements.   -- Gerard Schildberger (talk) 01:47, 11 May 2016 (UTC)

principal Nth root

I assume that this task wants the   principal   Nth   root?   It usually goes without saying, but ya never know.   -1.41421···   is one of the square roots.   -- Gerard Schildberger (talk) 03:08, 11 May 2016 (UTC)

That is in fact what I meant. How do I sign my comments?
Help page on signatures --Andreas Perstinger (talk) 04:08, 11 May 2016 (UTC)
Thanks! Zelah (talk) 04:18, 11 May 2016 (UTC)

could the task description be made nicer?

I wrote it but I can just imagine people's eyes glazing over. Maybe there is a simpler or more accessible way to convey the same information? Zelah (talk) 05:19, 11 May 2016 (UTC)

A usual way to deal with dense description is to show an example. Another is to describe it from a different perspective, or a second time, consciously choosing different words (some tasks here go overboard and specify specific algorithms - sometimes to the detriment of the task, but that's another issue). If that gets too involved, another variant includes a reference to some off-site material (often we use wikipedia). Many tasks here include specific cases - in fact, many tasks require specific examples be illustrated for some more general code. --Rdm (talk) 05:48, 11 May 2016 (UTC)
Would you (or someone else) be willing to improve the description? I'm not really much of a writer. Zelah (talk) 06:22, 11 May 2016 (UTC)
Maybe - I need to sleep on this. --Rdm (talk) 06:36, 11 May 2016 (UTC)

Precision

The desired precision should either be parameterized or specified in the task description. --Rdm (talk) 05:41, 11 May 2016 (UTC)

I think the precision is already specified. It is to the nearest integer. The Python example demonstrates that integer values are sufficient to emulate real numbers. The trick with square roots is to multiply the number by 100 for every additional digit of accuracy after the decimal point. For a 7th root you would multiply by 10,000,000 for every additional digit of accuracy. Zelah (talk) 06:07, 11 May 2016 (UTC)
Yeah - I should have phrased this as a specifying the value you are taking the root of. --Rdm (talk) 06:37, 11 May 2016 (UTC)

is it possible to fix "R^N=X" in the task description?

I want it to look like math notation not computer code. Zelah (talk) 22:13, 11 May 2016 (UTC)