User talk:Petelomax: Difference between revisions

(Added new section and comments.)
Line 134:
 
I tend to forget about poor old Windows as these days I'm 'Linux only'. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 19:19, 19 May 2020 (UTC)
 
 
== Isqrt (integer square root) of X ==
 
In your '''Phix''' entry, you have:
mpz q = mpz_init(1),
r = mpz_init(0),
t = mpz_init(0),
z = mpz_init_set(x)
where   '''t'''   is initialized to zero.
 
Is that a necessary thing to do?
 
'''t'''   doesn't need to be initialized as it's set/defined later in the program.
 
 
Also, is the
!=0 then ?9/0
part of some semantic sugar that is needed to check for division by zero?
 
 
I looked at the entry for   [[Integer_roots#Phix]]   and it appears that that
example (program) requires   '''n'''   to be an integer and is apparently not an "mpz" thingy.
 
I am not familiar at all with the '''Phix''' language, so I am most assuredly missing something.
 
 
The function mentioned in your link may be simpler and shorter, but the Rosetta Code task was
to implement an integer square root function as per the pseudocode.   I wouldn't object
to you entering an alternative '''Phix''' version in the discussion page for this task.     -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 06:59, 16 July 2020 (UTC)
 
 
By the way, the (draft) task has been changed, only the '''odd''' powers of seven are to be shown.   I had
inadvertently left out the word   '''odd'''.     -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 06:59, 16 July 2020 (UTC)