[{"data":1,"prerenderedAt":300},["ShallowReactive",2],{"term-i\u002Finteger":3,"related-i\u002Finteger":289},{"id":4,"title":5,"acronym":6,"body":7,"category":271,"description":272,"difficulty":273,"extension":274,"letter":275,"meta":276,"navigation":89,"path":277,"related":278,"seo":283,"sitemap":284,"stem":287,"subcategory":6,"__hash__":288},"terms\u002Fterms\u002Fi\u002Finteger.md","Integer",null,{"type":8,"value":9,"toc":265},"minimark",[10,15,19,23,26,30,254,258,261],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18],"p",{},"An integer is a whole number — no decimal point. 1, 42, -7, 1000 are integers. 1.5 is NOT an integer, that is a float. Most languages have separate types for whole numbers and decimal numbers because computers store them differently in memory.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"An integer is a numeric data type representing whole numbers without a fractional component. In most languages, integers have a fixed size (8, 16, 32, or 64 bits) determining their range. A 32-bit signed integer holds -2,147,483,648 to 2,147,483,647. JavaScript has no integer type — only 64-bit floats — but provides BigInt for arbitrary precision integers.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Python integers (arbitrary precision):\nage = 25\nbig_number = 99999999999999999999  # no overflow in Python\n\n\u002F\u002F JavaScript (no true integer type):\nconst x = 42;           \u002F\u002F stored as float64\nconst y = 42.0;         \u002F\u002F same thing\nconsole.log(42 === 42.0); \u002F\u002F true!\n\n\u002F\u002F Check if integer in JS:\nNumber.isInteger(42);   \u002F\u002F true\nNumber.isInteger(42.5); \u002F\u002F false\n\n\u002F\u002F BigInt for large numbers:\nconst big = 9007199254740993n; \u002F\u002F n suffix = BigInt\n","javascript","",[38,39,40,49,64,84,91,97,118,136,168,173,179,201,222,227,233],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,48],{"class":47},"sHwdD","\u002F\u002F Python integers (arbitrary precision):\n",[41,50,52,56,60],{"class":43,"line":51},2,[41,53,55],{"class":54},"sTEyZ","age ",[41,57,59],{"class":58},"sMK4o","=",[41,61,63],{"class":62},"sbssI"," 25\n",[41,65,67,70,72,75,78,81],{"class":43,"line":66},3,[41,68,69],{"class":54},"big_number ",[41,71,59],{"class":58},[41,73,74],{"class":62}," 99999999999999999999",[41,76,77],{"class":54},"  # no overflow ",[41,79,80],{"class":58},"in",[41,82,83],{"class":54}," Python\n",[41,85,87],{"class":43,"line":86},4,[41,88,90],{"emptyLinePlaceholder":89},true,"\n",[41,92,94],{"class":43,"line":93},5,[41,95,96],{"class":47},"\u002F\u002F JavaScript (no true integer type):\n",[41,98,100,104,107,109,112,115],{"class":43,"line":99},6,[41,101,103],{"class":102},"spNyl","const",[41,105,106],{"class":54}," x ",[41,108,59],{"class":58},[41,110,111],{"class":62}," 42",[41,113,114],{"class":58},";",[41,116,117],{"class":47},"           \u002F\u002F stored as float64\n",[41,119,121,123,126,128,131,133],{"class":43,"line":120},7,[41,122,103],{"class":102},[41,124,125],{"class":54}," y ",[41,127,59],{"class":58},[41,129,130],{"class":62}," 42.0",[41,132,114],{"class":58},[41,134,135],{"class":47},"         \u002F\u002F same thing\n",[41,137,139,142,145,149,152,155,158,160,163,165],{"class":43,"line":138},8,[41,140,141],{"class":54},"console",[41,143,144],{"class":58},".",[41,146,148],{"class":147},"s2Zo4","log",[41,150,151],{"class":54},"(",[41,153,154],{"class":62},"42",[41,156,157],{"class":58}," ===",[41,159,130],{"class":62},[41,161,162],{"class":54},")",[41,164,114],{"class":58},[41,166,167],{"class":47}," \u002F\u002F true!\n",[41,169,171],{"class":43,"line":170},9,[41,172,90],{"emptyLinePlaceholder":89},[41,174,176],{"class":43,"line":175},10,[41,177,178],{"class":47},"\u002F\u002F Check if integer in JS:\n",[41,180,182,185,187,190,192,194,196,198],{"class":43,"line":181},11,[41,183,184],{"class":54},"Number",[41,186,144],{"class":58},[41,188,189],{"class":147},"isInteger",[41,191,151],{"class":54},[41,193,154],{"class":62},[41,195,162],{"class":54},[41,197,114],{"class":58},[41,199,200],{"class":47},"   \u002F\u002F true\n",[41,202,204,206,208,210,212,215,217,219],{"class":43,"line":203},12,[41,205,184],{"class":54},[41,207,144],{"class":58},[41,209,189],{"class":147},[41,211,151],{"class":54},[41,213,214],{"class":62},"42.5",[41,216,162],{"class":54},[41,218,114],{"class":58},[41,220,221],{"class":47}," \u002F\u002F false\n",[41,223,225],{"class":43,"line":224},13,[41,226,90],{"emptyLinePlaceholder":89},[41,228,230],{"class":43,"line":229},14,[41,231,232],{"class":47},"\u002F\u002F BigInt for large numbers:\n",[41,234,236,238,241,243,246,249,251],{"class":43,"line":235},15,[41,237,103],{"class":102},[41,239,240],{"class":54}," big ",[41,242,59],{"class":58},[41,244,245],{"class":62}," 9007199254740993",[41,247,248],{"class":102},"n",[41,250,114],{"class":58},[41,252,253],{"class":47}," \u002F\u002F n suffix = BigInt\n",[11,255,257],{"id":256},"when-youll-hear-this","When You'll Hear This",[16,259,260],{},"\"The ID field should be an integer.\" \u002F \"Be careful with integer overflow in C — use a larger type if needed.\"",[262,263,264],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":51,"depth":51,"links":266},[267,268,269,270],{"id":13,"depth":51,"text":14},{"id":21,"depth":51,"text":22},{"id":28,"depth":51,"text":29},{"id":256,"depth":51,"text":257},"general","An integer is a whole number — no decimal point. 1, 42, -7, 1000 are integers. 1.5 is NOT an integer, that is a float.","beginner","md","i",{},"\u002Fterms\u002Fi\u002Finteger",[279,184,280,281,282],"Float","Type","NaN","BigInt",{"title":5,"description":272},{"changefreq":285,"priority":286},"weekly",0.7,"terms\u002Fi\u002Finteger","w6j-BGPzIQRU37hC5kHVBAFj_eA_6OuPH8xnjdI1bFw",[290,293,297],{"title":279,"path":291,"acronym":6,"category":271,"difficulty":273,"description":292},"\u002Fterms\u002Ff\u002Ffloat","A float is a number with a decimal point — 3.14, 1.5, -0.001. The name comes from 'floating point' because the decimal point can be anywhere.",{"title":281,"path":294,"acronym":295,"category":271,"difficulty":273,"description":296},"\u002Fterms\u002Fn\u002Fnan","Not a Number","NaN means 'Not a Number' — it is what JavaScript gives you when math goes wrong in a weird way. Try to parse a word as a number and you get NaN.",{"title":280,"path":298,"acronym":6,"category":271,"difficulty":273,"description":299},"\u002Fterms\u002Ft\u002Ftype","A type tells the computer what kind of thing a value is — is it a number, text, true\u002Ffalse, or a list?",1776518289025]