lfzyx
V2EX  ›  问与答

问大家一个数学公式问题

  •  
  •   lfzyx · Jun 25, 2012 · 3273 views
    This topic created in 5072 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
        1
    manhere  
       Jun 25, 2012
    这叫“阶乘”啊。。。
    lfzyx
        2
    lfzyx  
    OP
       Jun 25, 2012
    @manhere 那就是没有人类可以手工计算的公式了?
    qiayue
        3
    qiayue  
    PRO
       Jun 25, 2012
    楼主问的是例如 (a + b)^2 = a^2 + b^2 +2ab 这种公式吧?
    T_Seed
        4
    T_Seed  
       Jun 25, 2012
    手工计算的话,从中间向两边会简单一些~~
    zythum
        5
    zythum  
       Jun 25, 2012
    阶乘的话 一般写做 n! = n*(n-1)!

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

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