lfzyx
V2EX  ›  问与答

问大家一个数学公式问题

  •  
  •   lfzyx · Jun 25, 2012 · 3692 views
    This topic created in 5245 days ago, the information mentioned may be changed or developed.
    例如
    1*2*3*4.....*1000=?
    这样的

    有没有计算公式?
    9 replies  •  1970-01-01 08:00:00 +08:00
    manhere
    manhere
    Jun 25, 2012
    1
    这叫“阶乘”啊。。。
    lfzyx
    lfzyx
    OP
    Jun 25, 2012
    2
    @manhere 那就是没有人类可以手工计算的公式了?
    qiayue
    qiayue
    Jun 25, 2012
    3
    楼主问的是例如 (a + b)^2 = a^2 + b^2 +2ab 这种公式吧?
    T_Seed
    T_Seed
    Jun 25, 2012
    4
    手工计算的话,从中间向两边会简单一些~~
    zythum
    zythum
    Jun 25, 2012
    5
    阶乘的话 一般写做 n! = n*(n-1)!

    话说为什么要手工算?高中数学都有计算机啊..

    刚刚蛋疼了下。还能再精简么?
    for(var n=prompt('多少的阶乘?'),r=1;n;r*=n--);alert(r);
    phuslu
    phuslu
    Jun 25, 2012
    6
    zythum
    zythum
    Jun 25, 2012
    7
    这样还能短点
    for(var n=prompt('多少的阶乘?'),r=1;n||alert(r);r*=n--)
    lfzyx
    lfzyx
    OP
    Jun 25, 2012
    8
    @zythum 根据n! = n*(n-1)!这个公式,算到最后1×(1-1)!,那不是0了?
    lfzyx
    lfzyx
    OP
    Jun 25, 2012
    9
    哦,0的阶乘是1
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4828 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 09:21 · PVG 17:21 · LAX 01:21 · JFK 04:21
    ♥ Do have faith in what you're doing.