سؤال

I want to factorise integers, for example

41748850938502584251

I want to factorise this using brute-force. Given the short length of this number this should be possible.

What's a suitable programming language which supports an integer data type that has arbitrary length?

هل كانت مفيدة؟

المحلول

Scheme has a featureful numeric tower that provides, among other things, arbitrary precision integers (see sec. 3.4 of R6RS which requires this of conforming implementations).

نصائح أخرى

You could use Perl. Put

use bigint;

at the beginning of your program.

Java's BigInteger class handles very large numbers: http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html

Haskell has the Integer data type for unlimited integers. Likewise Frege (it uses Javas big integers).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top