爱意满满的作品展示区。
loveleyla2013

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

  •  
  •   loveleyla2013 · 11h 8m ago · 983 views

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

    • 纯本地计算,用的 GMP 的 wasm 版本
    • 如果你在网站上计算 PI 的 10000 位,理论上可以找到你的 4 位数生日
    • 如果你在网站上计算 PI 的 1,000,000 位,理论上可以找到你的 6 位数生日
    • 有兴趣的可以试试,还可以测试你的 CPU 单核性能
    4 replies    2026-07-14 08:25:23 +08:00
    osilinka
        1
    osilinka  
       10h 3m ago
    直接找那个 txt 文件不是更简单
    opengps
        2
    opengps  
       5h 39m ago
    即刻上曾经火过的一个小游戏
    loading
        3
    loading  
       5h 13m ago via Android
    根本不需要计算,做个 365 的映射就行了。
    cat9life
        4
    cat9life  
       5h 8m ago
    然而哈基米告诉我不需要计算。

    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("未在此大文件中找到该数字")
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4476 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 69ms · UTC 05:33 · PVG 13:33 · LAX 22:33 · JFK 01:33
    ♥ Do have faith in what you're doing.