## "Fossies" - the Fresh Open Source Software Archive ### Source code changes of the file "help/factor" betweencalc-2.12.7.2.tar.bz2 and calc-2.12.7.6.tar.bz2

About: Calc is a C-style arbitrary precision calculator.

factor  (calc-2.12.7.2.tar.bz2):factor  (calc-2.12.7.6.tar.bz2)
skipping to change at line 19 skipping to change at line 19
limit integer with abs(limit) < 2^32, defaults to 2^32 - 1 limit integer with abs(limit) < 2^32, defaults to 2^32 - 1
err integer err integer
return positive integer or err return positive integer or err
DESCRIPTION DESCRIPTION
This function ignores the signs of n and limit, so here we shall This function ignores the signs of n and limit, so here we shall
assume n and limit are both nonnegative. assume n and limit are both nonnegative.
If n has a prime proper factor less than or equal to limit, then If n has a prime proper factor less than or equal to limit, then
factor(n, limit) returns the smallest such factor(n, limit) returns the smallest such factor, or 1 if no
factor was found below the limit.
NOTE: A proper factor of n>1 is a factor < n. In other words, NOTE: A proper factor of n>1 is a factor < n. In other words,
for n>1 is not a proper factor of itself. The value 1 for n>1 is not a proper factor of itself. The value 1
is a special case because 1 is a proper factor of 1. is a special case because 1 is a proper factor of 1.
When every prime proper factor of n is greater than limit, 1 is When every prime proper factor of n is greater than limit, 1 is
returned. In particular, if limit < 2, factor(n, limit) always returned. In particular, if limit < 2, factor(n, limit) always
returns 1. Also, factor(n,2) returns 2 if and only if n is even returns 1. Also, factor(n,2) returns 2 if and only if n is even
and n > 2. and n > 2.
skipping to change at line 53 skipping to change at line 54
LIMITS LIMITS
limit < 2^32 limit < 2^32
FLAG zfactor(ZVALUE n, ZVALUE limit, ZVALUE *res) FLAG zfactor(ZVALUE n, ZVALUE limit, ZVALUE *res)
isprime, lfactor, nextcand, nextprime, prevcand, prevprime, isprime, lfactor, nextcand, nextprime, prevcand, prevprime,
pfact, pix, ptest pfact, pix, ptest
## Copyright (C) 1999-2006 Landon Curt Noll ## Copyright (C) 1999-2006,2021 Landon Curt Noll
## ##
## Calc is open software; you can redistribute it and/or modify it under ## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License ## the terms of the version 2.1 of the GNU Lesser General Public License