# How to use a higher precision?

Below is my code. If I set W to $10^{55}$, it breaks down and the result is wrong. What do I need to do to use W as large as $10^{200}$?

n = 15;
roots = Table[Sqrt[Prime[i]], {i, n}];
W = 10^45;
A = Table[0, {i, 1,  n + 1}, {j, 1, n + 1}];
A[[1, 1]] = 1;
For[i = 1, i <= n, i++, A[[1, i + 1]] = Round[W*roots[[i]]];];
For[i = 2, i <= n + 1, i++, A[[i, i]] = W; ];
b = LatticeReduce[A];
q = Abs[b[[1, 1]]]


The error message is here:

N::meprec: Internal precision limit $MaxExtraPrecision = 50. reached while evaluating -28254824730949473896127703534134355343731647793777+19979178168491741166272766531031078657045486457686 Sqrt[2]. My version is V9, and my OS is windows 7. • What do you mean by breakdown? Commented Mar 13, 2017 at 4:26 • @AnjanKumar See the error message above. Commented Mar 13, 2017 at 4:47 • In my system, I don't get any error message even for a W of$10^{100}$. You may try increasing $MaxExtraPrecision like this Block[{\$MaxExtraPrecision = 100}, Round[W*#] & /@ roots] Commented Mar 13, 2017 at 4:51
• This appears to be a version-dependent problem, or we are missing some other information. Please update your question to include the details of your platform. Commented Mar 13, 2017 at 5:31
• Thanks for providing version information. This might also be operating-system-dependent so it would be good to know if you are running this on Windows, OSX, or Linux. Commented Mar 13, 2017 at 13:15

This appears to work without error in v10.1 under Windows x64:

n = 15;
roots = Table[Sqrt[Prime[i]], {i, n}];
W = 10^200;
A = Table[0, {i, 1, n + 1}, {j, 1, n + 1}];
A[[1, 1]] = 1;
For[i = 1, i <= n, i++, A[[1, i + 1]] = Round[W*roots[[i]]];];
For[i = 2, i <= n + 1, i++, A[[i, i]] = W;];
b = LatticeReduce[A];
q = Abs[b[[1, 1]]]

485603484508849372516130007418504632602233691958877412852766931375138423098986536885\
657362770183762005362519092758826679723076465340151346365557521902058790127411374224\
440956272176411511
`
• I see. My version is Version 9. Commented Mar 13, 2017 at 5:37
• @S.Kohn Please include that information in the question itself. You can edit it at any time. Commented Mar 13, 2017 at 7:24