Copying numbers from PARI/GP

不打扰是莪最后的温柔 提交于 2019-12-11 04:09:11

问题


I have a problem, for which there probably is an easy solution.

Suppose, I have calculated a large number in PARI/GP, lets say, 10,000 digits long.

I want to copy this number in a normal text file, such that it can be copied back to PARI/GP.

The problem is, that the program does not avoid (hidden) new-line-marks, so if I copy the number back, it cannot be read by PARI. The print1-command does not help either.

I had two non-satisfactionary ideas :

1) Copying in an editor, using the backspace-key to remove the (hidden) new-line-marks, which only works upto some length.

2) Extending the allowed length of a line, but then I cannot easily and fast mark the number, which is no problem with the normal lentgh 80.

How can I avoid the new-line-marks in the output in PARI/GP ?


回答1:


Piotr already gave the answer in a comment. Suppose you have:

n = 1<<33216

or any other number. Then if you use:

write("MySavedNumber.txt", n)

things will be fine. No new-lines in the middle of the text file.

When you need to recover the number in another session of PARI/GP, simply use:

n = read("MySavedNumber.txt")


来源:https://stackoverflow.com/questions/32634395/copying-numbers-from-pari-gp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!