V2EX  ›  英汉词典
Enqueued related words: Do-While Loop

While Loop

释义 Definition

while loop“当……时循环”,一种常见的编程控制结构;只要给定的条件为真(true),就会反复执行一段代码。条件通常在每次循环开始时检查;若条件一直为真,可能导致无限循环。(也常写作 while-loop

例句 Examples

I used a while loop to keep asking until the user enters a valid password.
我用一个 while 循环不断询问,直到用户输入有效密码为止。

In the simulation, a while loop updates the system state each step and stops only when the error falls below a threshold, preventing unnecessary computation.
在该仿真中,while 循环在每一步更新系统状态,并且只有当误差低于阈值时才停止,从而避免不必要的计算。

发音 Pronunciation (IPA)

/waɪl luːp/

词源 Etymology

while 源自古英语 hwīl(“一段时间、期间”),后来引申出“当……的时候”。loop 原义与“圈、环形路径”相关(表示绕回、重复的路径)。在计算机科学语境中,loop(循环)用来比喻程序执行路径“绕回再走一遍”,因此 while loop 就是“在某条件成立期间不断重复执行”的结构。

相关词 Related Words

文献与作品 Notable Works

  • The C Programming Language(Kernighan & Ritchie)——介绍 C 语言中的 while 循环与控制流程
  • *Structure and Interpretation of Computer Programs (SICP)*——在过程与递归、迭代讨论中常出现循环思想与相关表达
  • The Java Language Specification——在语言规范层面描述 while 语句的语义
  • Python Tutorial(Python 官方教程)——以入门示例讲解 while 循环与 break/continue 的用法
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   686 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 22:00 · PVG 06:00 · LAX 14:00 · JFK 17:00
♥ Do have faith in what you're doing.