[{"data":1,"prerenderedAt":1539},["ShallowReactive",2],{"navigation-en":3,"page-\u002Fguide\u002Fcaveats":78,"surround-\u002Fguide\u002Fcaveats":1534},[4,26,56],{"title":5,"path":6,"stem":7,"children":8},"Introduction","\u002Fguide","1.guide\u002F1.index",[9,10,14,18,22],{"title":5,"path":6,"stem":7},{"title":11,"path":12,"stem":13},"Getting Started","\u002Fguide\u002Fgetting-started","1.guide\u002F2.getting-started",{"title":15,"path":16,"stem":17},"Number Formatting","\u002Fguide\u002Fformat-tokens","1.guide\u002F3.format-tokens",{"title":19,"path":20,"stem":21},"Performance","\u002Fguide\u002Fperformance","1.guide\u002F4.performance",{"title":23,"path":24,"stem":25},"Caveats","\u002Fguide\u002Fcaveats","1.guide\u002F5.caveats",{"title":27,"path":28,"stem":29,"children":30},"API Overview","\u002Fapi","2.api\u002F0.index",[31,32,36,40,44,48,52],{"title":27,"path":28,"stem":29},{"title":33,"path":34,"stem":35},"calc()","\u002Fapi\u002Fcalc","2.api\u002F1.calc",{"title":37,"path":38,"stem":39},"fmt()","\u002Fapi\u002Ffmt","2.api\u002F2.fmt",{"title":41,"path":42,"stem":43},"Chain API","\u002Fapi\u002Fchain","2.api\u002F3.chain",{"title":45,"path":46,"stem":47},"Standalone Functions","\u002Fapi\u002Fstandalone","2.api\u002F4.standalone",{"title":49,"path":50,"stem":51},"Aggregation","\u002Fapi\u002Faggregate","2.api\u002F5.aggregate",{"title":53,"path":54,"stem":55},"Global Config","\u002Fapi\u002Fconfig","2.api\u002F6.config",{"title":57,"path":58,"stem":59,"children":60},"Examples Overview","\u002Fexamples","3.examples\u002F0.index",[61,62,66,70,74],{"title":57,"path":58,"stem":59},{"title":63,"path":64,"stem":65},"Precision Loss","\u002Fexamples\u002Fprecision-loss","3.examples\u002F1.precision-loss",{"title":67,"path":68,"stem":69},"E-commerce","\u002Fexamples\u002Fecommerce","3.examples\u002F2.ecommerce",{"title":71,"path":72,"stem":73},"Complex Expressions","\u002Fexamples\u002Fcomplex","3.examples\u002F3.complex",{"title":75,"path":76,"stem":77},"Currency Conversion","\u002Fexamples\u002Fcurrency","3.examples\u002F4.currency",{"id":79,"title":23,"body":80,"description":1527,"extension":1528,"meta":1529,"navigation":1531,"path":24,"seo":1532,"stem":25,"__hash__":1533},"content_en\u002F1.guide\u002F5.caveats.md",{"type":81,"value":82,"toc":1515},"minimark",[83,87,91,101,126,422,438,445,454,725,732,774,954,958,968,1017,1035,1043,1071,1075,1097,1511],[84,85,23],"h1",{"id":86},"caveats",[88,89,90],"p",{},"A few boundaries worth scanning before you start — knowing these upfront can save a lot of debugging time.",[92,93,95,96,100],"h2",{"id":94},"_1-computation-errors-throw-only-fmt-has-a-fallback","1. Computation errors throw; only ",[97,98,99],"code",{},"fmt"," has a fallback",[88,102,103,106,107,111,112,115,116,121,122,125],{},[97,104,105],{},"calc",", standalone arithmetic functions, aggregation, and chaining all ",[108,109,110],"strong",{},"throw on error"," (invalid expression, invalid argument, etc.) — you need to handle these with ",[97,113,114],{},"try\u002Fcatch",". Only the display-oriented ",[117,118,119],"a",{"href":38},[97,120,99],{}," catches errors and returns a fallback value (default ",[97,123,124],{},"'-'",").",[127,128,134],"pre",{"className":129,"code":130,"language":131,"meta":132,"style":133},"language-ts shiki shiki-themes github-light github-light github-dark twoslash lsp","import { calc, fmt } from '@wzo\u002Fcalc'\n\u002F\u002F ---cut---\ncalc('1 \u002F x') \u002F\u002F ❌ throws: undefined variable\nfmt('1 \u002F x') \u002F\u002F \"-\"  ✅ fallback, page doesn't crash\n","ts","twoslash","",[97,135,136,359],{"__ignoreMap":133},[137,138,141,344,348,352,355],"span",{"class":139,"line":140},"line",1,[137,142,144],{"class":143},"snPdu",[145,146,149,151],"v-menu",{"class":147,"popper-class":148,"theme":132},"twoslash-hover","shiki twoslash-floating vp-copy-ignore",[137,150,105],{},[152,153,155],"template",{"v-slot:popper":154},"{}",[137,156,158,201,266],{"class":157,"v-pre":133},"twoslash-popup-container vp-copy-ignore",[97,159,161],{"class":160},"twoslash-popup-code",[127,162,166],{"class":163,"style":164,"tabindex":165},"shiki shiki-themes github-light github-light github-dark","--shiki-light:#24292e;--shiki-default:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-default-bg:#fff;--shiki-dark-bg:#24292e","0",[97,167,168,193],{},[137,169,170,174,177,180,184,187,190],{"class":139},[137,171,173],{"style":172},"--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E1E4E8","(alias) ",[137,175,105],{"style":176},"--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#B392F0",[137,178,179],{"style":172},"(expr: string, options",[137,181,183],{"style":182},"--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#F97583","?:",[137,185,186],{"style":172}," ICalcOptions): string ",[137,188,189],{"style":182},"|",[137,191,192],{"style":172}," number",[137,194,195,198],{"class":139},[137,196,197],{"style":182},"import",[137,199,200],{"style":172}," calc",[202,203,205,208,234,237,240,257,259],"div",{"class":204},"twoslash-popup-docs vp-doc",[88,206,207],{},"Main entry point: evaluates an arithmetic expression string and optionally formats the output.",[88,209,210,211,214,215,214,218,221,222,225,226,229,230,233],{},"Expressions are pure arithmetic: the four basic operations, parentheses, and math functions\n(",[97,212,213],{},"max","\u002F",[97,216,217],{},"min",[97,219,220],{},"clamp","…). ",[108,223,224],{},"Variables are not supported"," — embed values directly in the\nexpression via template interpolation: ",[97,227,228],{},"calc(`${price} * ${qty}`)",".\nFormatting is specified via ",[97,231,232],{},"options._fmt"," (an",[88,235,236],{},"IFormat",[88,238,239],{},"object).",[88,241,242,244,245,248,249,252,253,256],{},[97,243,105],{}," is designed for ",[108,246,247],{},"computation",": on error (invalid expression, etc.) it ",[108,250,251],{},"throws\ndirectly"," and the caller is responsible for handling it.\nFor ",[108,254,255],{},"display"," scenarios that need a fallback on error, use",[88,258,99],{},[88,260,261,262,265],{},"instead\n(same API and supports arithmetic, but returns ",[97,263,264],{},"_error"," on failure rather than throwing).",[202,267,269,290,300,324,332],{"class":268},"twoslash-popup-docs twoslash-popup-docs-tags vp-doc",[137,270,272,276],{"class":271},"twoslash-popup-docs-tag",[137,273,275],{"class":274},"twoslash-popup-docs-tag-name","@param",[137,277,279,282,283,286,287],{"class":278},"twoslash-popup-docs-tag-value",[97,280,281],{},"expr","  Arithmetic expression, e.g. ",[97,284,285],{},"'1 + 2 * 3'",", ",[97,288,289],{},"'(1 + 2) \u002F 3'",[137,291,292,294],{"class":271},[137,293,275],{"class":274},[137,295,296,299],{"class":278},[97,297,298],{},"options","  Control options (see ICalcOptions)",[137,301,302,305],{"class":271},[137,303,304],{"class":274},"@returns",[137,306,307,308,311,312,315,316,319,320,323],{"class":278},"Computation result (",[97,309,310],{},"string","; ",[97,313,314],{},"number"," when ",[97,317,318],{},"_fmt.output"," is ",[97,321,322],{},"'number'",")",[137,325,326,329],{"class":271},[137,327,328],{"class":274},"@throws",[137,330,331],{"class":278},"Throws when the expression is invalid",[137,333,334,337],{"class":271},[137,335,336],{"class":274},"@example",[137,338,339,340,343],{"class":278},"calc('1 + 2 * 3')                        \u002F\u002F '7'\ncalc(",[97,341,342],{},"${price} * ${qty}",")                \u002F\u002F use template interpolation instead of variables\ncalc('1 + 2', { _fmt: { decimals: 2 } }) \u002F\u002F '3.00'",[137,345,347],{"class":346},"sxrX7","(",[137,349,351],{"class":350},"sIIMD","'1 \u002F x'",[137,353,354],{"class":346},") ",[137,356,358],{"class":357},"sCsY4","\u002F\u002F ❌ throws: undefined variable\n",[137,360,362,413,415,417,419],{"class":139,"line":361},2,[137,363,364],{"class":143},[145,365,366,368],{"class":147,"popper-class":148,"theme":132},[137,367,99],{},[152,369,370],{"v-slot:popper":154},[137,371,372],{"class":157,"v-pre":133},[97,373,374],{"class":160},[127,375,376],{"class":163,"style":164,"tabindex":165},[97,377,378,406],{},[137,379,380,382,384,387,389,392,394,397,399,402,404],{"class":139},[137,381,173],{"style":172},[137,383,99],{"style":176},[137,385,386],{"style":172},"(value: string ",[137,388,189],{"style":182},[137,390,391],{"style":172}," number ",[137,393,189],{"style":182},[137,395,396],{"style":172}," bigint, options",[137,398,183],{"style":182},[137,400,401],{"style":172}," IFmtOptions): string ",[137,403,189],{"style":182},[137,405,192],{"style":172},[137,407,408,410],{"class":139},[137,409,197],{"style":182},[137,411,412],{"style":172}," fmt",[137,414,347],{"class":346},[137,416,351],{"class":350},[137,418,354],{"class":346},[137,420,421],{"class":357},"\u002F\u002F \"-\"  ✅ fallback, page doesn't crash\n",[423,424,426],"callout",{"type":425},"info",[88,427,428,429],{},"Rule of thumb: ",[108,430,431,432,434,435,437],{},"use ",[97,433,105],{}," for computation (errors should be visible), use ",[97,436,99],{}," for display (stable, no crashes).",[92,439,441,442,444],{"id":440},"_2-calc-has-no-variables-use-template-interpolation","2. ",[97,443,105],{}," has no variables — use template interpolation",[88,446,447,449,450,453],{},[97,448,105],{}," is pure arithmetic evaluation — there is ",[108,451,452],{},"no variable support",". Interpolate values directly into the expression string:",[127,455,457],{"className":129,"code":456,"language":131,"meta":132,"style":133},"import { calc } from '@wzo\u002Fcalc'\n\u002F\u002F ---cut---\nconst price = 9.9\nconst qty = 3\ncalc(`${price} * ${qty}`) \u002F\u002F ✅ \"29.7\"\n\u002F\u002F calc('price * qty', { price, qty }) ← old syntax, no longer supported\n",[97,458,459,500,534,719],{"__ignoreMap":133},[137,460,461,465,469,494,497],{"class":139,"line":140},[137,462,464],{"class":463},"s8jYJ","const",[137,466,468],{"class":467},"sBjJW"," ",[137,470,471],{"class":467},[145,472,473,476],{"class":147,"popper-class":148,"theme":132},[137,474,475],{},"price",[152,477,478],{"v-slot:popper":154},[137,479,480],{"class":157,"v-pre":133},[97,481,482,484,488,491],{"class":160},[137,483,464],{"style":182},[137,485,487],{"style":486},"--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#79B8FF"," price",[137,489,490],{"style":182},":",[137,492,493],{"style":486}," 9.9",[137,495,496],{"class":463}," =",[137,498,499],{"class":467}," 9.9\n",[137,501,502,504,506,529,531],{"class":139,"line":361},[137,503,464],{"class":463},[137,505,468],{"class":467},[137,507,508],{"class":467},[145,509,510,513],{"class":147,"popper-class":148,"theme":132},[137,511,512],{},"qty",[152,514,515],{"v-slot:popper":154},[137,516,517],{"class":157,"v-pre":133},[97,518,519,521,524,526],{"class":160},[137,520,464],{"style":182},[137,522,523],{"style":486}," qty",[137,525,490],{"style":182},[137,527,528],{"style":486}," 3",[137,530,496],{"class":463},[137,532,533],{"class":467}," 3\n",[137,535,537,663,665,668,688,691,711,714,716],{"class":139,"line":536},3,[137,538,539],{"class":143},[145,540,541,543],{"class":147,"popper-class":148,"theme":132},[137,542,105],{},[152,544,545],{"v-slot:popper":154},[137,546,547,575,613],{"class":157,"v-pre":133},[97,548,549],{"class":160},[127,550,551],{"class":163,"style":164,"tabindex":165},[97,552,553,569],{},[137,554,555,557,559,561,563,565,567],{"class":139},[137,556,173],{"style":172},[137,558,105],{"style":176},[137,560,179],{"style":172},[137,562,183],{"style":182},[137,564,186],{"style":172},[137,566,189],{"style":182},[137,568,192],{"style":172},[137,570,571,573],{"class":139},[137,572,197],{"style":182},[137,574,200],{"style":172},[202,576,577,579,593,595,597,607,609],{"class":204},[88,578,207],{},[88,580,210,581,214,583,214,585,221,587,225,589,229,591,233],{},[97,582,213],{},[97,584,217],{},[97,586,220],{},[108,588,224],{},[97,590,228],{},[97,592,232],{},[88,594,236],{},[88,596,239],{},[88,598,599,244,601,248,603,252,605,256],{},[97,600,105],{},[108,602,247],{},[108,604,251],{},[108,606,255],{},[88,608,99],{},[88,610,261,611,265],{},[97,612,264],{},[202,614,615,627,635,649,655],{"class":268},[137,616,617,619],{"class":271},[137,618,275],{"class":274},[137,620,621,282,623,286,625],{"class":278},[97,622,281],{},[97,624,285],{},[97,626,289],{},[137,628,629,631],{"class":271},[137,630,275],{"class":274},[137,632,633,299],{"class":278},[97,634,298],{},[137,636,637,639],{"class":271},[137,638,304],{"class":274},[137,640,307,641,311,643,315,645,319,647,323],{"class":278},[97,642,310],{},[97,644,314],{},[97,646,318],{},[97,648,322],{},[137,650,651,653],{"class":271},[137,652,328],{"class":274},[137,654,331],{"class":278},[137,656,657,659],{"class":271},[137,658,336],{"class":274},[137,660,339,661,343],{"class":278},[97,662,342],{},[137,664,347],{"class":346},[137,666,667],{"class":350},"`${",[137,669,670],{"class":346},[145,671,672,674],{"class":147,"popper-class":148,"theme":132},[137,673,475],{},[152,675,676],{"v-slot:popper":154},[137,677,678],{"class":157,"v-pre":133},[97,679,680,682,684,686],{"class":160},[137,681,464],{"style":182},[137,683,487],{"style":486},[137,685,490],{"style":182},[137,687,493],{"style":486},[137,689,690],{"class":350},"} * ${",[137,692,693],{"class":346},[145,694,695,697],{"class":147,"popper-class":148,"theme":132},[137,696,512],{},[152,698,699],{"v-slot:popper":154},[137,700,701],{"class":157,"v-pre":133},[97,702,703,705,707,709],{"class":160},[137,704,464],{"style":182},[137,706,523],{"style":486},[137,708,490],{"style":182},[137,710,528],{"style":486},[137,712,713],{"class":350},"}`",[137,715,354],{"class":346},[137,717,718],{"class":357},"\u002F\u002F ✅ \"29.7\"\n",[137,720,722],{"class":139,"line":721},4,[137,723,724],{"class":357},"\u002F\u002F calc('price * qty', { price, qty }) ← old syntax, no longer supported\n",[92,726,728,729,731],{"id":727},"_3-number-returning-variants-lose-precision-above-253","3. ",[97,730,314],{},"-returning variants lose precision above 2^53",[88,733,734,737,738,737,741,737,744,746,747,749,750,753,754,468,757,737,760,737,763,737,766,769,770,737,772,490],{},[97,735,736],{},"add"," \u002F ",[97,739,740],{},"sub",[97,742,743],{},"mul",[97,745,202],{}," return ",[97,748,314],{},". Results exceeding ",[97,751,752],{},"Number.MAX_SAFE_INTEGER"," (2^53) will lose precision. For monetary values or large integers, use the ",[108,755,756],{},"string variants",[97,758,759],{},"addStr",[97,761,762],{},"subStr",[97,764,765],{},"mulStr",[97,767,768],{},"divStr",", or use ",[97,771,105],{},[97,773,99],{},[127,775,777],{"className":129,"code":776,"language":131,"meta":132,"style":133},"import { add, addStr } from '@wzo\u002Fcalc'\n\u002F\u002F ---cut---\nadd('9007199254740993', '1') \u002F\u002F 9007199254740994 ← number, may not be exact\naddStr('9007199254740993', '1') \u002F\u002F \"9007199254740994\" ✅ string, no loss\n",[97,778,779,869],{"__ignoreMap":133},[137,780,781,854,856,859,861,864,866],{"class":139,"line":140},[137,782,783],{"class":143},[145,784,785,787],{"class":147,"popper-class":148,"theme":132},[137,786,736],{},[152,788,789],{"v-slot:popper":154},[137,790,791,818,826],{"class":157,"v-pre":133},[97,792,793],{"class":160},[127,794,795],{"class":163,"style":164,"tabindex":165},[97,796,797,811],{},[137,798,799,801,803,805,808],{"class":139},[137,800,173],{"style":172},[137,802,736],{"style":176},[137,804,347],{"style":172},[137,806,807],{"style":182},"...",[137,809,810],{"style":172},"args: Val[]): number",[137,812,813,815],{"class":139},[137,814,197],{"style":182},[137,816,817],{"style":172}," add",[202,819,820],{"class":204},[88,821,822,823,825],{},"High-precision addition, result converted to ",[97,824,314],{}," (convenient for interop with native numbers).",[202,827,828,838,847],{"class":268},[137,829,830,832],{"class":271},[137,831,275],{"class":274},[137,833,834,837],{"class":278},[97,835,836],{},"args","  Any number of addends, accumulated left to right",[137,839,840,842],{"class":271},[137,841,304],{"class":274},[137,843,844,845,323],{"class":278},"Sum (",[97,846,314],{},[137,848,849,851],{"class":271},[137,850,336],{"class":274},[137,852,853],{"class":278},"add(0.1, 0.2)       \u002F\u002F 0.3\nadd(1, 2, 3, 4)     \u002F\u002F 10",[137,855,347],{"class":346},[137,857,858],{"class":350},"'9007199254740993'",[137,860,286],{"class":346},[137,862,863],{"class":350},"'1'",[137,865,354],{"class":346},[137,867,868],{"class":357},"\u002F\u002F 9007199254740994 ← number, may not be exact\n",[137,870,871,941,943,945,947,949,951],{"class":139,"line":361},[137,872,873],{"class":143},[145,874,875,877],{"class":147,"popper-class":148,"theme":132},[137,876,759],{},[152,878,879],{"v-slot:popper":154},[137,880,881,907,915],{"class":157,"v-pre":133},[97,882,883],{"class":160},[127,884,885],{"class":163,"style":164,"tabindex":165},[97,886,887,900],{},[137,888,889,891,893,895,897],{"class":139},[137,890,173],{"style":172},[137,892,759],{"style":176},[137,894,347],{"style":172},[137,896,807],{"style":182},[137,898,899],{"style":172},"args: Val[]): string",[137,901,902,904],{"class":139},[137,903,197],{"style":182},[137,905,906],{"style":172}," addStr",[202,908,909],{"class":204},[88,910,911,912,914],{},"High-precision addition, result returned as ",[97,913,310],{}," (no precision loss; suitable for monetary values).",[202,916,917,926,934],{"class":268},[137,918,919,921],{"class":271},[137,920,275],{"class":274},[137,922,923,925],{"class":278},[97,924,836],{},"  Any number of addends",[137,927,928,930],{"class":271},[137,929,304],{"class":274},[137,931,844,932,323],{"class":278},[97,933,310],{},[137,935,936,938],{"class":271},[137,937,336],{"class":274},[137,939,940],{"class":278},"addStr('0.1', '0.2') \u002F\u002F '0.3'",[137,942,347],{"class":346},[137,944,858],{"class":350},[137,946,286],{"class":346},[137,948,863],{"class":350},[137,950,354],{"class":346},[137,952,953],{"class":357},"\u002F\u002F \"9007199254740994\" ✅ string, no loss\n",[92,955,957],{"id":956},"_4-input-precision-values-may-already-be-corrupted-before-they-arrive","4. Input precision: values may already be corrupted before they arrive",[88,959,960,961,964,965,967],{},"For precision-sensitive values (monetary amounts, large integers), ",[108,962,963],{},"pass them as strings",". A ",[97,966,314],{}," literal can be corrupted by JS floating-point before it ever reaches the function — the library cannot recover from that:",[127,969,972],{"className":970,"code":971,"language":131,"meta":133,"style":133},"language-ts shiki shiki-themes github-light github-light github-dark","addStr(0.1 + 0.2, 0) \u002F\u002F \"0.30000000000000004\" ← argument already corrupted\naddStr('0.1', '0.2') \u002F\u002F \"0.3\" ✅\n",[97,973,974,998],{"__ignoreMap":133},[137,975,976,978,980,983,986,989,991,993,995],{"class":139,"line":140},[137,977,759],{"class":143},[137,979,347],{"class":346},[137,981,982],{"class":467},"0.1",[137,984,985],{"class":463}," +",[137,987,988],{"class":467}," 0.2",[137,990,286],{"class":346},[137,992,165],{"class":467},[137,994,354],{"class":346},[137,996,997],{"class":357},"\u002F\u002F \"0.30000000000000004\" ← argument already corrupted\n",[137,999,1000,1002,1004,1007,1009,1012,1014],{"class":139,"line":361},[137,1001,759],{"class":143},[137,1003,347],{"class":346},[137,1005,1006],{"class":350},"'0.1'",[137,1008,286],{"class":346},[137,1010,1011],{"class":350},"'0.2'",[137,1013,354],{"class":346},[137,1015,1016],{"class":357},"\u002F\u002F \"0.3\" ✅\n",[88,1018,1019,1020,1023,1024,1026,1027,1030,1031,1034],{},"The same applies to template interpolation: ",[97,1021,1022],{},"calc(`${0.1} + ${0.2}`)"," is fine (interpolating the literals ",[97,1025,982],{}," and ",[97,1028,1029],{},"0.2","), but ",[97,1032,1033],{},"calc(`${0.1 + 0.2}`)"," first evaluates with floating-point and the result is already wrong.",[92,1036,1038,1039,1042],{"id":1037},"_5-configuration-setconfig-is-a-singleton-with-ordering-requirements","5. Configuration: ",[97,1040,1041],{},"setConfig"," is a singleton with ordering requirements",[88,1044,1045,1047,1048,1051,1052,1055,1056,737,1058,1060,1061,1064,1065,1070],{},[97,1046,1041],{}," modifies a ",[108,1049,1050],{},"global singleton"," and must be called ",[108,1053,1054],{},"before"," any ",[97,1057,105],{},[97,1059,99],{}," invocations (typically in ",[97,1062,1063],{},"main.ts","). If you only need different precision for a single division or average without affecting global state, pass ",[117,1066,1067],{"href":54},[97,1068,1069],{},"{ _precision }"," at the call site — no ordering concerns.",[92,1072,1074],{"id":1073},"_6-division-defaults-to-50-decimal-places","6. Division defaults to 50 decimal places",[88,1076,1077,1078,1081,1082,1085,1086,1089,1090,1092,1093,1096],{},"Repeating decimals (e.g. ",[97,1079,1080],{},"1 \u002F 3",") are computed to ",[108,1083,1084],{},"50 places"," by default. To adjust, use ",[97,1087,1088],{},"_precision"," (computation precision) or ",[97,1091,99],{},"'s ",[97,1094,1095],{},"decimals"," (display places):",[127,1098,1100],{"className":129,"code":1099,"language":131,"meta":132,"style":133},"import { divStr, fmt } from '@wzo\u002Fcalc'\n\u002F\u002F ---cut---\ndivStr('1', '3') \u002F\u002F \"0.333…\" to 50 places\ndivStr('1', '3', { _precision: 10 }) \u002F\u002F \"0.3333333333\"\nfmt('1 \u002F 3', { decimals: 4 }) \u002F\u002F \"0.3333\"\n",[97,1101,1102,1220,1366],{"__ignoreMap":133},[137,1103,1104,1206,1208,1210,1212,1215,1217],{"class":139,"line":140},[137,1105,1106],{"class":143},[145,1107,1108,1110],{"class":147,"popper-class":148,"theme":132},[137,1109,768],{},[152,1111,1112],{"v-slot:popper":154},[137,1113,1114,1154,1179],{"class":157,"v-pre":133},[97,1115,1116],{"class":160},[127,1117,1118],{"class":163,"style":164,"tabindex":165},[97,1119,1120,1147],{},[137,1121,1122,1124,1126,1128,1130,1133,1135,1138,1141,1144],{"class":139},[137,1123,173],{"style":172},[137,1125,768],{"style":176},[137,1127,347],{"style":172},[137,1129,807],{"style":182},[137,1131,1132],{"style":172},"args: Val[]): ",[137,1134,310],{"style":176},[137,1136,1137],{"style":172}," (",[137,1139,1140],{"style":182},"+",[137,1142,1143],{"style":486},"1",[137,1145,1146],{"style":172}," overload)",[137,1148,1149,1151],{"class":139},[137,1150,197],{"style":182},[137,1152,1153],{"style":172}," divStr",[202,1155,1156,1166],{"class":204},[88,1157,1158,1159,1161,1162,1165],{},"High-precision division, result as ",[97,1160,310],{},": ",[97,1163,1164],{},"args[0] \u002F args[1] \u002F ...",".",[88,1167,1168,1169,1171,1172,1174,1175,1178],{},"Precision defaults to the global ",[97,1170,1088],{},"; pass ",[97,1173,1069],{}," as the ",[108,1176,1177],{},"last"," argument\nto override it for this call only (does not affect the global config).",[202,1180,1181,1190,1199],{"class":268},[137,1182,1183,1185],{"class":271},[137,1184,275],{"class":274},[137,1186,1187,1189],{"class":278},[97,1188,836],{},"  Dividend and divisors, with an optional IPrecisionOption at the end",[137,1191,1192,1194],{"class":271},[137,1193,304],{"class":274},[137,1195,1196,1197,323],{"class":278},"Quotient (",[97,1198,310],{},[137,1200,1201,1203],{"class":271},[137,1202,336],{"class":274},[137,1204,1205],{"class":278},"divStr('1', '3')                      \u002F\u002F '0.333...' (global precision)\ndivStr('100', '3', { _precision: 5 }) \u002F\u002F '33.33333'",[137,1207,347],{"class":346},[137,1209,863],{"class":350},[137,1211,286],{"class":346},[137,1213,1214],{"class":350},"'3'",[137,1216,354],{"class":346},[137,1218,1219],{"class":357},"\u002F\u002F \"0.333…\" to 50 places\n",[137,1221,1222,1312,1314,1316,1318,1320,1323,1355,1357,1360,1363],{"class":139,"line":361},[137,1223,1224],{"class":143},[145,1225,1226,1228],{"class":147,"popper-class":148,"theme":132},[137,1227,768],{},[152,1229,1230],{"v-slot:popper":154},[137,1231,1232,1272,1288],{"class":157,"v-pre":133},[97,1233,1234],{"class":160},[127,1235,1236],{"class":163,"style":164,"tabindex":165},[97,1237,1238,1266],{},[137,1239,1240,1242,1244,1246,1248,1251,1253,1256,1258,1260,1262,1264],{"class":139},[137,1241,173],{"style":172},[137,1243,768],{"style":176},[137,1245,347],{"style":172},[137,1247,807],{"style":182},[137,1249,1250],{"style":172},"args: [",[137,1252,807],{"style":182},[137,1254,1255],{"style":172},"Val[], IPrecisionOption]): ",[137,1257,310],{"style":176},[137,1259,1137],{"style":172},[137,1261,1140],{"style":182},[137,1263,1143],{"style":486},[137,1265,1146],{"style":172},[137,1267,1268,1270],{"class":139},[137,1269,197],{"style":182},[137,1271,1153],{"style":172},[202,1273,1274,1280],{"class":204},[88,1275,1158,1276,1161,1278,1165],{},[97,1277,310],{},[97,1279,1164],{},[88,1281,1168,1282,1171,1284,1174,1286,1178],{},[97,1283,1088],{},[97,1285,1069],{},[108,1287,1177],{},[202,1289,1290,1298,1306],{"class":268},[137,1291,1292,1294],{"class":271},[137,1293,275],{"class":274},[137,1295,1296,1189],{"class":278},[97,1297,836],{},[137,1299,1300,1302],{"class":271},[137,1301,304],{"class":274},[137,1303,1196,1304,323],{"class":278},[97,1305,310],{},[137,1307,1308,1310],{"class":271},[137,1309,336],{"class":274},[137,1311,1205],{"class":278},[137,1313,347],{"class":346},[137,1315,863],{"class":350},[137,1317,286],{"class":346},[137,1319,1214],{"class":350},[137,1321,1322],{"class":346},", { ",[137,1324,1325],{"class":346},[145,1326,1327,1329],{"class":147,"popper-class":148,"theme":132},[137,1328,1088],{},[152,1330,1331],{"v-slot:popper":154},[137,1332,1333,1347],{"class":157,"v-pre":133},[97,1334,1335,1338,1340,1342,1344],{"class":160},[137,1336,1337],{"style":172},"(property) IPrecisionOption._precision",[137,1339,183],{"style":182},[137,1341,391],{"style":172},[137,1343,189],{"style":182},[137,1345,1346],{"style":486}," undefined",[202,1348,1349],{"class":204},[88,1350,1351,1352,1354],{},"Division precision for this call, overrides the global ",[97,1353,1088],{}," (does not affect the global config).",[137,1356,1161],{"class":346},[137,1358,1359],{"class":467},"10",[137,1361,1362],{"class":346}," }) ",[137,1364,1365],{"class":357},"\u002F\u002F \"0.3333333333\"\n",[137,1367,1368,1414,1416,1419,1421,1501,1503,1506,1508],{"class":139,"line":536},[137,1369,1370],{"class":143},[145,1371,1372,1374],{"class":147,"popper-class":148,"theme":132},[137,1373,99],{},[152,1375,1376],{"v-slot:popper":154},[137,1377,1378],{"class":157,"v-pre":133},[97,1379,1380],{"class":160},[127,1381,1382],{"class":163,"style":164,"tabindex":165},[97,1383,1384,1408],{},[137,1385,1386,1388,1390,1392,1394,1396,1398,1400,1402,1404,1406],{"class":139},[137,1387,173],{"style":172},[137,1389,99],{"style":176},[137,1391,386],{"style":172},[137,1393,189],{"style":182},[137,1395,391],{"style":172},[137,1397,189],{"style":182},[137,1399,396],{"style":172},[137,1401,183],{"style":182},[137,1403,401],{"style":172},[137,1405,189],{"style":182},[137,1407,192],{"style":172},[137,1409,1410,1412],{"class":139},[137,1411,197],{"style":182},[137,1413,412],{"style":172},[137,1415,347],{"class":346},[137,1417,1418],{"class":350},"'1 \u002F 3'",[137,1420,1322],{"class":346},[137,1422,1423],{"class":346},[145,1424,1425,1427],{"class":147,"popper-class":148,"theme":132},[137,1426,1095],{},[152,1428,1429],{"v-slot:popper":154},[137,1430,1431,1479],{"class":157,"v-pre":133},[97,1432,1433],{"class":160},[127,1434,1435],{"class":163,"style":164,"tabindex":165},[97,1436,1437,1451,1461,1470],{},[137,1438,1439,1442,1444,1446,1448],{"class":139},[137,1440,1441],{"style":172},"(property) IFormat.decimals",[137,1443,183],{"style":182},[137,1445,391],{"style":172},[137,1447,189],{"style":182},[137,1449,1450],{"style":172}," {",[137,1452,1453,1456,1458],{"class":139},[137,1454,1455],{"style":172},"    min",[137,1457,183],{"style":182},[137,1459,1460],{"style":172}," number;",[137,1462,1463,1466,1468],{"class":139},[137,1464,1465],{"style":172},"    max",[137,1467,183],{"style":182},[137,1469,1460],{"style":172},[137,1471,1472,1475,1477],{"class":139},[137,1473,1474],{"style":172},"} ",[137,1476,189],{"style":182},[137,1478,1346],{"style":486},[202,1480,1481],{"class":204},[88,1482,1483,1484,1487,1488,1491,1492,286,1495,1491,1498,323],{},"Decimal places: number = fixed (",[97,1485,1486],{},"=N","); object = range (",[97,1489,1490],{},"{ max }","≡",[97,1493,1494],{},"\u003C=N",[97,1496,1497],{},"{ min }",[97,1499,1500],{},">=N",[137,1502,1161],{"class":346},[137,1504,1505],{"class":467},"4",[137,1507,1362],{"class":346},[137,1509,1510],{"class":357},"\u002F\u002F \"0.3333\"\n",[1512,1513,1514],"style",{},"html pre.shiki code .snPdu, html code.shiki .snPdu{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sxrX7, html code.shiki .sxrX7{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sBjJW, html code.shiki .sBjJW{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s8jYJ, html code.shiki .s8jYJ{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sIIMD, html code.shiki .sIIMD{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#9ECBFF}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":133,"searchDepth":361,"depth":361,"links":1516},[1517,1519,1521,1523,1524,1526],{"id":94,"depth":361,"text":1518},"1. Computation errors throw; only fmt has a fallback",{"id":440,"depth":361,"text":1520},"2. calc has no variables — use template interpolation",{"id":727,"depth":361,"text":1522},"3. number-returning variants lose precision above 2^53",{"id":956,"depth":361,"text":957},{"id":1037,"depth":361,"text":1525},"5. Configuration: setConfig is a singleton with ordering requirements",{"id":1073,"depth":361,"text":1074},"A few edge cases worth knowing before you start — error handling, precision pitfalls, and configuration scope.","md",{"icon":1530},"i-lucide-triangle-alert",true,{"title":23,"description":1527},"LpCWTFAsoMuyPeGU7apdjn_YCzU99yDRDnC2oYwJBzc",[1535,1537],{"title":19,"path":20,"stem":21,"description":1536,"children":-1},"Zero runtime dependencies, ~12KB gzip; precision arithmetic still reaches millions of operations per second.",{"title":27,"path":28,"stem":29,"description":1538,"children":-1},"Quick reference for all exports from @wzo\u002Fcalc.",1783414278853]