<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"><channel><title>MagicLen</title><link>https://magiclen.org/cn/tag/factorial/</link><description>多元化原创文章，内容包罗万象，有编程语言、网站应用、软件介绍、硬件介绍、操作系统、旅行游记、专题采访、益智问题、文学创作，以及作者们的知识分享和作品分享。</description><language>zh-CN</language><lastBuildDate>Sun, 22 Nov 2026 18:46:35 +0800</lastBuildDate><atom:link href="https://magiclen.org/cn/tag/factorial/feed/" rel="self" type="application/rss+xml"/><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>8</sy:updateFrequency><sy:updateBase>1970-01-01T00:00+00:00</sy:updateBase><item><title>写程序算阶乘，关于阶乘的三两事</title><link>https://magiclen.org/cn/factorial/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2022/08/factorial-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2022/08/factorial-220x162.png 1x, https://magiclen.org/wp-content/uploads/2022/08/factorial-440x324.png 2x, https://magiclen.org/wp-content/uploads/2022/08/factorial-660x486.png 3x" alt>
正整数的阶乘(Factorial)是小于或等于该数的所有正整数的乘积，若正整数为 N，用 N! 来表示 N 的阶乘。至于 0! 是阶乘的特例，它被定义为 1。阶乘的运算具有递归(recursion)概念，常作为学习程序逻辑的材料，而这篇文章将会说明阶乘相关的程序计算。]]></description><category>研究分享</category><category>Go</category><category>Java</category><category>数学逻辑</category><category>Rust</category><category>JavaScript</category><category>Java</category><category>JavaScript</category><category>Rust</category><category>TypeScript</category><category>阶乘</category><category>Go</category><guid>https://magiclen.org/cn/factorial</guid><pubDate>Thu, 27 Oct 2022 12:00:00 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>如何将递归函数改成迭代函数？</title><link>https://magiclen.org/cn/recursive-to-iterative/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2020/04/mathematics-1509559_1920-220x162.jpg" srcset="https://magiclen.org/wp-content/uploads/2020/04/mathematics-1509559_1920-220x162.jpg 1x, https://magiclen.org/wp-content/uploads/2020/04/mathematics-1509559_1920-440x324.jpg 2x, https://magiclen.org/wp-content/uploads/2020/04/mathematics-1509559_1920-660x486.jpg 3x" alt>
递归(Recursive)函数是在运行的过程又会直接或间接地调用自己本身的函数。通常透过递归函数可以快速地验证我们的算法，用简短的代码处理复杂的问题，但是函数在调用时需要创建新的堆栈框(Stack Frame)，除了会需要额外的开支(Overhead)之外，如果在函数中调用函数，而这函数又会调用函数，持续下去，很容易就会造成堆栈溢出(Stack Overflow)。虽然有些编程语言的编译器会做尾端...]]></description><category>研究分享</category><category>Go</category><category>Java</category><category>Rust</category><category>JavaScript</category><category>Java</category><category>JavaScript</category><category>Rust</category><category>二元搜索</category><category>TypeScript</category><category>费氏数列</category><category>阶乘</category><category>Go</category><guid>https://magiclen.org/cn/recursive-to-iterative</guid><pubDate>Thu, 11 Jun 2020 12:00:44 +0800</pubDate><dc:creator>Magic Len</dc:creator></item></channel></rss>