diff options
-rw-r--r-- | coreutils/factor.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/coreutils/factor.c b/coreutils/factor.c index 4a131813b..7400174a7 100644 --- a/coreutils/factor.c +++ b/coreutils/factor.c | |||
@@ -203,6 +203,23 @@ static NOINLINE void factorize(wide_t N) | |||
203 | int factor_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 203 | int factor_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
204 | int factor_main(int argc UNUSED_PARAM, char **argv) | 204 | int factor_main(int argc UNUSED_PARAM, char **argv) |
205 | { | 205 | { |
206 | #if 0 /* test isqrt() correctness */ | ||
207 | wide_t n = argv[1] ? bb_strtoull(argv[1], NULL, 0) : time(NULL); | ||
208 | for (;;) { | ||
209 | half_t h; | ||
210 | if (--n == 0) | ||
211 | --n; | ||
212 | h = isqrt(n); | ||
213 | if (!(n & 0xff)) | ||
214 | printf("isqrt(%llx)=%"HALF_FMT"x\n", n, h); | ||
215 | if ((wide_t)h * h > n) | ||
216 | return 1; | ||
217 | h++; | ||
218 | if (h != 0 && (wide_t)h * h <= n) | ||
219 | return 1; | ||
220 | } | ||
221 | #endif | ||
222 | |||
206 | //// coreutils has undocumented option ---debug (three dashes) | 223 | //// coreutils has undocumented option ---debug (three dashes) |
207 | //getopt32(argv, ""); | 224 | //getopt32(argv, ""); |
208 | //argv += optind; | 225 | //argv += optind; |