在线求 π 任意位的小工具,可以查到你的生日在 π 的多少位

loveleyla2013 2026-07-14 02:25 1

网页: https://roy2100.github.io/pi-calculator



  • 纯本地计算,用的 GMP 的 wasm 版本

  • 如果你在网站上计算 PI 的 10000 位,理论上可以找到你的 4 位数生日

  • 如果你在网站上计算 PI 的 1,000,000 位,理论上可以找到你的 6 位数生日

  • 有兴趣的可以试试,还可以测试你的 CPU 单核性能

最新回复 (4)
  • osilinka 07-14 03:29
    1
    直接找那个 txt 文件不是更简单
  • opengps 07-14 07:54
    2
    即刻上曾经火过的一个小游戏
  • loading 07-14 08:20
    3
    根本不需要计算,做个 365 的映射就行了。
  • cat9life 07-14 08:25
    4
    然而哈基米告诉我不需要计算。

    import mmap

    def search_large_pi(search_target, file_path):
    target_bytes = str(search_target).encode('utf-8')

    with open(file_path, "r+b") as f:
    # 创建内存映射
    with mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) as mm:
    position = mm.find(target_bytes)
    if position != -1:
    print(f"找到位置:小数点后第 {position + 1} 位")
    else:
    print("未在此大文件中找到该数字")
* 帖子来源V2EX
返回