This Challenge is to read a text file that has vary large integers up to 2e18, typical for Google Code Jam. These values are well within the bounds of uint64.
The data is an array of Q pairs.
Input: [Q, fname] The number of lines in the file and its filename.
Output: M a uint64 matrix of size(Q,2)
Example:
Input: {4, 'Cody_64.txt']
The text file:
308436464205151562 1850618785230909388
373665302816212423 1494661211264849698
760961177192651897 1521922354385303795
1 2000000000000000000
Ouput: A uint64 (4,2) matrix to full precision.
Note of Warning:
The fscanf function with %ul may not succeed, as of 7/20/2013.
The result window has a case showing the function output
Related Challenges:
1) Bullseye Large Numbers r<1E18, P<2E18
2) Super Large Numbers >2^64 (Java BigInteger methods)
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers13
Suggested Problems
-
824 Solvers
-
Create One Large Eye of size N x N Quickly?
95 Solvers
-
Find a subset that divides the vector into equal halves
400 Solvers
-
Create a matrix X, where each column is a shifted copy of the vector v
221 Solvers
-
194 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
That was painful to lear xD .
Btw i really think its about time some document the capabilities of str2num properly ( i mean the eval like capabilties)
The file 'Cody_64.txt' is missing in the first two tests. It could be created using the code in the third test (and changing the file name).
> The fscanf function with %ul may not succeed, as of 7/20/2013.
The correct format identifier is %lu --- using that, it works.