1"use strict";(globalThis.webpackChunkdocs=globalThis.webpackChunkdocs||[]).push([[1295],{74170(e,n,o){o.r(n),o.d(n,{assets:()=>l,contentTitle:()=>i,default:()=>p,frontMatter:()=>r,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"language/data_types/booleans","title":"Booleans","description":"Delve into the Boolean data type in Noir. Understand its methods, practical examples, and best practices for using Booleans in your Noir programs.","source":"@site/versioned_docs/version-v1.0.0-rc.0/language/data_types/booleans.md","sourceDirName":"language/data_types","slug":"/language/data_types/booleans","permalink":"/docs/v1.0.0-rc.0/language/data_types/booleans","draft":false,"unlisted":false,"editUrl":"https://github.com/noir-lang/noir/edit/master/docs/versioned_docs/version-v1.0.0-rc.0/language/data_types/booleans.md","tags":[],"version":"v1.0.0-rc.0","frontMatter":{"title":"Booleans","description":"Delve into the Boolean data type in Noir. Understand its methods, practical examples, and best practices for using Booleans in your Noir programs.","keywords":["noir","boolean type","methods","examples","logical operations"]},"sidebar":"sidebar","previous":{"title":"Integers","permalink":"/docs/v1.0.0-rc.0/language/data_types/integers"},"next":{"title":"Strings","permalink":"/docs/v1.0.0-rc.0/language/data_types/strings"}}');var s=o(74848),a=o(28453);const r={title:"Booleans",description:"Delve into the Boolean data type in Noir. Understand its methods, practical examples, and best practices for using Booleans in your Noir programs.",keywords:["noir","boolean type","methods","examples","logical operations"]},i=void 0,l={},c=[];function d(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"bool"})," type in Noir has two possible values: ",(0,s.jsx)(n.code,{children:"true"})," and ",(0,s.jsx)(n.code,{children:"false"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-rust",children:"fn main() {\n let t = true;\n let f: bool = false;\n}\n"})}),"\n",(0,s.jsxs)(n.p,{children:["The boolean type is most commonly used in conditionals like ",(0,s.jsx)(n.code,{children:"if"})," expressions and ",(0,s.jsx)(n.code,{children:"assert"}),"\nstatements. More about conditionals is covered in the ",(0,s.jsx)(n.a,{href:"/docs/v1.0.0-rc.0/language/control_flow",children:"Control Flow"})," and\n",(0,s.jsx)(n.a,{href:"/docs/v1.0.0-rc.0/language/assert",children:"Assert Function"})," sections."]})]})}function p(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},28453(e,n,o){o.d(n,{R:()=>r,x:()=>i});var t=o(96540);const s={},a=t.createContext(s);function r(e){const n=t.useContext(a);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),t.createElement(a.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.