bool:布尔类型;一种只表示两种逻辑值的基本数据类型,通常为 true/false(真/假)。常见于编程语言与逻辑表达式中。
/ˈbuːl/
A bool can be either true or false.
bool 可以是真或假。
The function returns a bool indicating whether the user is authenticated, which helps the system decide what content to display.
该函数返回一个 bool,用来表示用户是否已通过认证,从而帮助系统决定显示哪些内容。
bool 通常被认为是 Boolean(布尔的)的缩写;而 Boolean 源自英国数学家 George Boole(乔治·布尔) 的姓氏,他的逻辑代数为现代计算机科学与数字电路奠定了基础。
bool 主要是编程术语,更多出现在技术书籍而非传统文学作品中;在计算机经典教材中常见,例如: