1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["19010"],{3666(e,n,r){r.r(n),r.d(n,{metadata:()=>c,default:()=>u,frontMatter:()=>a,contentTitle:()=>i,toc:()=>d,assets:()=>o});var c=JSON.parse('{"id":"api/functions/compareFunc","title":"Function: compareFunc()","description":"compareFunc\\\\(): Arbitrary\\\\ number\\\\>","source":"@site/docs/api/functions/compareFunc.md","sourceDirName":"api/functions","slug":"/api/functions/compareFunc","permalink":"/docs/api/functions/compareFunc","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedBy":null,"lastUpdatedAt":null,"frontMatter":{"mdx":{"format":"md"}},"sidebar":"tutorialSidebar","previous":{"title":"Function: compareBooleanFunc()","permalink":"/docs/api/functions/compareBooleanFunc"},"next":{"title":"Function: configureGlobal()","permalink":"/docs/api/functions/configureGlobal"}}'),t=r(61058),s=r(24801);let a={mdx:{format:"md"}},i="Function: compareFunc()",o={},d=[{value:"Type Parameters",id:"type-parameters",level:2},{value:"Returns",id:"returns",level:2},{value:"Remarks",id:"remarks",level:2}];function l(e){let n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"function-comparefunc",children:"Function: compareFunc()"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"compareFunc"}),"<",(0,t.jsx)(n.code,{children:"T"}),">(): ",(0,t.jsx)(n.a,{href:"/docs/api/classes/Arbitrary",children:(0,t.jsx)(n.code,{children:"Arbitrary"})}),"<(",(0,t.jsx)(n.code,{children:"a"}),", ",(0,t.jsx)(n.code,{children:"b"}),") => ",(0,t.jsx)(n.code,{children:"number"}),">"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["Defined in: ",(0,t.jsx)(n.a,{href:"https://github.com/dubzzz/fast-check/blob/014cc87e29e807fd7028e4cc05d8a6cd12da172b/packages/fast-check/src/arbitrary/compareFunc.ts#L21",children:"packages/fast-check/src/arbitrary/compareFunc.ts:21"})]}),"\n",(0,t.jsx)(n.p,{children:"For comparison functions"}),"\n",(0,t.jsx)(n.p,{children:"A comparison function returns:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["negative value whenever ",(0,t.jsx)(n.code,{children:"a < b"})]}),"\n",(0,t.jsxs)(n.li,{children:["positive value whenever ",(0,t.jsx)(n.code,{children:"a > b"})]}),"\n",(0,t.jsxs)(n.li,{children:["zero whenever ",(0,t.jsx)(n.code,{children:"a"})," and ",(0,t.jsx)(n.code,{children:"b"})," are equivalent"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["Comparison functions are transitive: ",(0,t.jsx)(n.code,{children:"a < b and b < c => a < c"})]}),"\n",(0,t.jsxs)(n.p,{children:["They also satisfy: ",(0,t.jsx)(n.code,{children:"a < b <=> b > a"})," and ",(0,t.jsx)(n.code,{children:"a = b <=> b = a"})]}),"\n",(0,t.jsx)(n.h2,{id:"type-parameters",children:"Type Parameters"}),"\n\n\n\n\n\n\n\n\n\n\n\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsx)(n.tr,{children:(0,t.jsx)(n.th,{children:"Type Parameter"})})}),(0,t.jsx)(n.tbody,{children:(0,t.jsx)(n.tr,{children:(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"T"})})})})]}),"\n",(0,t.jsx)(n.h2,{id:"returns",children:"Returns"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"/docs/api/classes/Arbitrary",children:(0,t.jsx)(n.code,{children:"Arbitrary"})}),"<(",(0,t.jsx)(n.code,{children:"a"}),", ",(0,t.jsx)(n.code,{children:"b"}),") => ",(0,t.jsx)(n.code,{children:"number"}),">"]}),"\n",(0,t.jsx)(n.h2,{id:"remarks",children:"Remarks"}),"\n",(0,t.jsx)(n.p,{children:"Since 1.6.0"})]})}function u(e={}){let{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},24801(e,n,r){r.d(n,{R:()=>a,x:()=>i});var c=r(13706);let t={},s=c.createContext(t);function a(e){let n=c.useContext(s);return c.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(t):e.components||t:a(e.components),c.createElement(s.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.