Which language is best to handle extremely large numbers? [closed] - windows

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I want to handle extremely large integer values of a few million digits for an experiment I'm conducting.
Which language is best for this? I know some languages such as batch have pre-established limits on how many digits it can handle.
I have a large RAM and 64-bit OS, so my machine isn't a problem.
Regards,
-Master-chip

in python 3.x the int type does not have a limit so if you are just looking for a suggestion I would check out python.
see https://docs.python.org/3.1/whatsnew/3.0.html#integers
What are you looking to do with the numbers? If your number is larger than the maximum value of an unsigned 64 bit long is 18446744073709551615 then you won't be able to use the normal types and will want to look at languages that support bigInts http://docs.oracle.com/javase/6/docs/api/java/math/BigInteger.html
Honestly there are solutions for this in most languages you will just have to pick the one you want to work with and look at its solution
Can you store these values as Strings?
Do you need complete accuracy of the numbers or can you store them as floats

Related

Is there a priority queue implementation in ATS? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I need to do some sort of priority-based search. Could someone point me to a priority queue implementation in ATS?
You can readily base a priority queue on a binomial heap.
There are two implementations of binomial heaps in ATS. Here are some use-cases:
https://github.com/githwxi/ATS-Postiats/blob/master/doc/EXAMPLE/ATSLIB/libats_linheap_binomial.dats
https://github.com/githwxi/ATS-Postiats/blob/master/doc/EXAMPLE/ATSLIB/libats_linheap_binomial2.dats
I came up with some unsafe C-based max-heap (based on somebody else's gist). I think that it does show that interfacing with C code in ATS, while generally unsafe, is very easy to do.
See the full sample at Glot.io
EDIT: here's another implementation, this time in ATS. It's a bit of a hassle to use, though (too many indexes in the type!), but the key salient feature of this code is that it is type-safe while also being extremely close to a typical C implementation in terms of runtime behavior.

Hashmap data structure in CUDA [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am looking for a high performance data structure on GPU (preferably over CUDA). The CUDPP is something cool but it does not satisfy my requirements because I want my key to be fixed size int array. I need to query 10k+ queries per second over a KEY-VALUE store of size 1M+. Is there any library already providing such type of functionality. I tried alternates on CPU but they are not that good for the purpose.
I haven't used it, though I have heard about a hashmap extension for CUDA Thrust. Present here:
Cuda-thrust-extensions library

Algorithm for grouping similar words (or short phrases) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am looking for an algorithm which would help me classify/group similar words (e.g., "Amazon.com" is similar to "Amazon" or "Amz" or "Amzon"). Levenshtein is a commonly suggested algorithm to use, but there are others like Jaro Winkler and such (for example, this is the Python library with a few word similarity metrics)
I'm wondering if those, who have done similar word aggregation/grouping, might have more effective suggestions. Thank you!
I have done something like this. I used Levenshtein with a lot of heuristics.
You should really look at the data and try to figure out what works best for you. Jaro Winkler works well for names. If you try to use it for md5 ids you're going to have a bad time.
If your strings are naturally very close to each other both approaches might not have insufficient granularity to help you, or you might need some more information from external sources.
In conclusion, try to setup some sandbox environment and try running different algorithms through the data and see which one works better. You can also look at the mistakes each algorithm makes and see if a) you can live with it or b) you can fix it easily.

Error recovery algorithms? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am doing a software that grabs in the end a numeric string, that string encodes important data, and any error destroy the contents.
Worse: It is VERY prone for errors, because of how data is transmitted (and I can do nothing about it).
So I decided to add a verification digit of sorts... After some research, I have more questions than answers... So, someone can point me to a decent location to study more about that subject?
Also, someone know some popular algorithms that can even fix errors, or at least point where the errors are, so I can retry grabbing the data with error?
Also what I do, if the checksum data itself managed to be wrong in transmission?
Hamming Code
simple pdf explanation of hamming code
Basically for every N bits of your message, you have some check bits.
You can detect and correct errors in the check bits, based on the data, or errors in the data, based on check bits. Too many errors though, and it's just garbage. There may be a utility in your language of choice to already do this.
This can be of use: http://www.eccpage.com/

How to validate a passport? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Well I have been asked to validate passport numbers (the documents used on airports to travel to other countries).
My question is: What format are these "numbers"? All I know is that they can have letters but I am not finding any place defining the rules. Any pointers/Links?
I don't think you're going to be able to do this without restricting yourself to certain issuing countries. If you look at the specs of machine readable passports:
http://www.highprogrammer.com/alan/numbers/mrp.html
It says that each country is free to use any format it likes for the actual passport number (including letters or digits). Although in the machine readable schema these seem to be limited to 9 characters (which might cause problems for countries with billions of citizens if they were to just use digits!)
I would expect the format to depend on the issuing country.
UK passport numbers consist of 9 digits but used to consist of 6 digits and a letter.

Resources