1"use strict";(globalThis.webpackChunklilaq=globalThis.webpackChunklilaq||[]).push([[8243],{15894(e,s,a){a.r(s),a.d(s,{assets:()=>c,contentTitle:()=>l,default:()=>o,frontMatter:()=>i,metadata:()=>n,toc:()=>m});const n=JSON.parse('{"id":"reference/Math/sign","title":"sign","description":"Returns the sign of a number.","source":"@site/docs/reference/Math/sign.mdx","sourceDirName":"reference/Math","slug":"/reference/sign","permalink":"/docs/reference/sign","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"slug":"/reference/sign","description":"Returns the sign of a number."},"sidebar":"tutorialSidebar","previous":{"title":"pow10","permalink":"/docs/reference/pow10"},"next":{"title":"Vec","permalink":"/docs/category/vec"}}');var t=a(74848),r=a(28453);const i={slug:"/reference/sign",description:"Returns the sign of a number."},l=void 0,c={},m=[{value:"<ParamName>value</ParamName> : <Typstref><code>int</code></Typstref> | <Typstref><code>float</code></Typstref>",id:"value",level:4}];function h(e){const s={a:"a",annotation:"annotation",code:"code",h4:"h4",li:"li",math:"math",mi:"mi",mn:"mn",mo:"mo",mrow:"mrow",p:"p",semantics:"semantics",span:"span",ul:"ul",...(0,r.R)(),...e.components},{Param:a,ParamName:n,Parameters:i,Signature:l,SignatureName:c,SignatureParam:m,SourceLink:h,Typstref:o}=s;return a||d("Param",!0),n||d("ParamName",!0),i||d("Parameters",!0),l||d("Signature",!0),c||d("SignatureName",!0),m||d("SignatureParam",!0),h||d("SourceLink",!0),o||d("Typstref",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l,{children:(0,t.jsxs)("code",{children:["lq.",(0,t.jsx)(c,{children:"sign"}),"(",(0,t.jsx)(m,{children:(0,t.jsx)(s.a,{href:"#value",children:"value"})}),")",(0,t.jsx)(h,{href:"https://github.com/lilaq-project/lilaq/tree/main/src/math.typ"})]})}),"\n",(0,t.jsx)(s.p,{children:"Returns the sign of a number."}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"0"})," for ",(0,t.jsxs)(s.span,{className:"katex",children:[(0,t.jsx)(s.span,{className:"katex-mathml",children:(0,t.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(s.semantics,{children:[(0,t.jsxs)(s.mrow,{children:[(0,t.jsx)(s.mi,{children:"x"}),(0,t.jsx)(s.mo,{children:"="}),(0,t.jsx)(s.mn,{children:"0"})]}),(0,t.jsx)(s.annotation,{encoding:"application/x-tex",children:"x=0"})]})})}),(0,t.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,t.jsxs)(s.span,{className:"base",children:[(0,t.jsx)(s.span,{className:"strut",style:{height:"0.4306em"}}),(0,t.jsx)(s.span,{className:"mord mathnormal",children:"x"}),(0,t.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,t.jsx)(s.span,{className:"mrel",children:"="}),(0,t.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,t.jsxs)(s.span,{className:"base",children:[(0,t.jsx)(s.span,{className:"strut",style:{height:"0.6444em"}}),(0,t.jsx)(s.span,{className:"mord",children:"0"})]})]})]})]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"1"})," for ",(0,t.jsxs)(s.span,{className:"katex",children:[(0,t.jsx)(s.span,{className:"katex-mathml",children:(0,t.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(s.semantics,{children:[(0,t.jsxs)(s.mrow,{children:[(0,t.jsx)(s.mi,{children:"x"}),(0,t.jsx)(s.mo,{children:">"}),(0,t.jsx)(s.mn,{children:"0"})]}),(0,t.jsx)(s.annotation,{encoding:"application/x-tex",children:"x>0"})]})})}),(0,t.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,t.jsxs)(s.span,{className:"base",children:[(0,t.jsx)(s.span,{className:"strut",style:{height:"0.5782em",verticalAlign:"-0.0391em"}}),(0,t.jsx)(s.span,{className:"mord mathnormal",children:"x"}),(0,t.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,t.jsx)(s.span,{className:"mrel",children:">"}),(0,t.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,t.jsxs)(s.span,{className:"base",children:[(0,t.jsx)(s.span,{className:"strut",style:{height:"0.6444em"}}),(0,t.jsx)(s.span,{className:"mord",children:"0"})]})]})]})]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"-1"})," for ",(0,t.jsxs)(s.span,{className:"katex",children:[(0,t.jsx)(s.span,{className:"katex-mathml",children:(0,t.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(s.semantics,{children:[(0,t.jsxs)(s.mrow,{children:[(0,t.jsx)(s.mi,{children:"x"}),(0,t.jsx)(s.mo,{children:"<"}),(0,t.jsx)(s.mn,{children:"0"})]}),(0,t.jsx)(s.annotation,{encoding:"application/x-tex",children:"x<0"})]})})}),(0,t.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,t.jsxs)(s.span,{className:"base",children:[(0,t.jsx)(s.span,{className:"strut",style:{height:"0.5782em",verticalAlign:"-0.0391em"}}),(0,t.jsx)(s.span,{className:"mord mathnormal",children:"x"}),(0,t.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,t.jsx)(s.span,{className:"mrel",children:"<"}),(0,t.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,t.jsxs)(s.span,{className:"base",children:[(0,t.jsx)(s.span,{className:"strut",style:{height:"0.6444em"}}),(0,t.jsx)(s.span,{className:"mord",children:"0"})]})]})]}),"\nNote that this is different from the built-in\n",(0,t.jsx)(s.a,{href:"https://typst.app/docs/reference/foundations/float/#definitions-signum",children:(0,t.jsx)(s.code,{children:"float.signum()"})}),"\nwhich returns ",(0,t.jsx)(s.code,{children:"1.0"})," for ",(0,t.jsxs)(s.span,{className:"katex",children:[(0,t.jsx)(s.span,{className:"katex-mathml",children:(0,t.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(s.semantics,{children:[(0,t.jsxs)(s.mrow,{children:[(0,t.jsx)(s.mi,{children:"x"}),(0,t.jsx)(s.mo,{children:"="}),(0,t.jsx)(s.mn,{children:"0"})]}),(0,t.jsx)(s.annotation,{encoding:"application/x-tex",children:"x=0"})]})})}),(0,t.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,t.jsxs)(s.span,{className:"base",children:[(0,t.jsx)(s.span,{className:"strut",style:{height:"0.4306em"}}),(0,t.jsx)(s.span,{className:"mord mathnormal",children:"x"}),(0,t.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,t.jsx)(s.span,{className:"mrel",children:"="}),(0,t.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,t.jsxs)(s.span,{className:"base",children:[(0,t.jsx)(s.span,{className:"strut",style:{height:"0.6444em"}}),(0,t.jsx)(s.span,{className:"mord",children:"0"})]})]})]}),"."]}),"\n"]}),"\n",(0,t.jsxs)(i,{children:[(0,t.jsxs)(s.h4,{id:"value",children:[(0,t.jsx)(n,{children:"value"})," : ",(0,t.jsx)(o,{target:"https://typst.app/docs/reference/foundations/int",children:(0,t.jsx)(s.code,{children:"int"})})," | ",(0,t.jsx)(o,{target:"https://typst.app/docs/reference/foundations/float",children:(0,t.jsx)(s.code,{children:"float"})})]}),(0,t.jsx)(a,{children:(0,t.jsx)(s.p,{children:"The value to determine the sign of."})})]})]})}function o(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}function d(e,s){throw new Error("Expected "+(s?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},28453(e,s,a){a.d(s,{R:()=>i,x:()=>l});var n=a(96540);const t={},r=n.createContext(t);function i(e){const s=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),n.createElement(r.Provider,{value:s},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.