[{"data":1,"prerenderedAt":1607},["ShallowReactive",2],{"content-query-hcRE7AIRO2":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"created":10,"updated":10,"body":11,"_type":1601,"_id":1602,"_source":1603,"_file":1604,"_stem":1605,"_extension":1606},"/blog/emacs-bra-size-calculator","blog",false,"","Emacs bra size calculator","recently i needed some new bras. my measurements had changed a bit since last time, so to make my life easier(?) i decided to write a bra size calculator that i can use in Emacs. the core function, my-math-compute-bra-size, is as follows:","2026-05-27",{"type":12,"children":13,"toc":1599},"root",[14,31,1370,1375,1408,1445,1461,1475,1516,1538,1543,1593],{"type":15,"tag":16,"props":17,"children":18},"element","p",{},[19,22,29],{"type":20,"value":21},"text","recently i needed some new bras. my measurements had changed a bit since last time, so to make my life easier(?) i decided to write a bra size calculator that i can use in Emacs. the core function, ",{"type":15,"tag":23,"props":24,"children":26},"code",{"className":25},[],[27],{"type":20,"value":28},"my-math-compute-bra-size",{"type":20,"value":30},", is as follows:",{"type":15,"tag":32,"props":33,"children":37},"pre",{"className":34,"code":35,"language":36,"meta":7,"style":7},"language-elisp shiki shiki-themes github-dark","(defun my-math-compute-bra-size (band-expr bust-expr &optional region)\n  (cl-flet ((to-unit (expr unit)\n              (string-to-number\n               (calc-eval (math-convert-units\n                           (calc-eval expr 'raw)\n                           (calc-eval unit 'raw)\n                           t)))))\n    (let* ((region-info-alist\n            '((eu . ((unit . \"cm\")\n                     (cups . ((12 . \"AA\") (14 . \"A\") (16 . \"B\") (18 . \"C\")\n                              (20 . \"D\") (22 . \"E\") (24 . \"F\") (26 . \"G\")\n                              (28 . \"H\") (30 . \"I\") (32 . \"J\") (34 . \"K\")))))\n              (uk . ((unit . \"in\")\n                     (cups . ((1 . \"AA\") (2 . \"A\") (3 . \"B\") (4 . \"C\")\n                              (5 . \"D\") (6 . \"DD\") (7 . \"E\") (8 . \"F\")\n                              (9 . \"FF\") (10 . \"G\") (11 . \"GG\") (12 . \"H\")))))\n              (us . ((unit . \"in\")\n                     (cups . ((1 . \"AA\") (2 . \"A\") (3 . \"B\") (4 . \"C\")\n                              (5 . \"D\") (6 . \"DD/E\") (7 . \"DDD/F\") (8 . \"DDDD/G\")\n                              (9 . \"H\") (10 . \"I\") (11 . \"J\") (12 . \"K\")))))))\n           (region (or region 'eu))\n           (region-info (alist-get region region-info-alist))\n           (unit (alist-get 'unit region-info))\n           (cups (alist-get 'cups region-info))\n           (band (to-unit band-expr unit))\n           (bust (to-unit bust-expr unit))\n           (diff (- bust band))\n           (cup (or (cdr (seq-find (lambda (x) (\u003C diff (car x))) cups))\n                    (format \"%s+\" (cdar (last cups))))))\n      (format \"%s%s\" (round band) cup diff))))\n","elisp",[38],{"type":15,"tag":23,"props":39,"children":40},{"__ignoreMap":7},[41,97,116,130,149,176,201,215,234,267,359,440,520,550,634,711,788,817,897,972,1045,1082,1105,1128,1150,1159,1168,1195,1268,1325],{"type":15,"tag":42,"props":43,"children":46},"span",{"class":44,"line":45},"line",1,[47,53,59,65,70,76,81,87,92],{"type":15,"tag":42,"props":48,"children":50},{"style":49},"--shiki-default:#E1E4E8",[51],{"type":20,"value":52},"(",{"type":15,"tag":42,"props":54,"children":56},{"style":55},"--shiki-default:#F97583",[57],{"type":20,"value":58},"defun",{"type":15,"tag":42,"props":60,"children":62},{"style":61},"--shiki-default:#B392F0",[63],{"type":20,"value":64}," my-math-compute-bra-size",{"type":15,"tag":42,"props":66,"children":67},{"style":49},[68],{"type":20,"value":69}," (",{"type":15,"tag":42,"props":71,"children":73},{"style":72},"--shiki-default:#FFAB70",[74],{"type":20,"value":75},"band-expr",{"type":15,"tag":42,"props":77,"children":78},{"style":72},[79],{"type":20,"value":80}," bust-expr",{"type":15,"tag":42,"props":82,"children":84},{"style":83},"--shiki-default:#79B8FF",[85],{"type":20,"value":86}," &optional",{"type":15,"tag":42,"props":88,"children":89},{"style":72},[90],{"type":20,"value":91}," region",{"type":15,"tag":42,"props":93,"children":94},{"style":49},[95],{"type":20,"value":96},")\n",{"type":15,"tag":42,"props":98,"children":100},{"class":44,"line":99},2,[101,106,111],{"type":15,"tag":42,"props":102,"children":103},{"style":49},[104],{"type":20,"value":105},"  (",{"type":15,"tag":42,"props":107,"children":108},{"style":83},[109],{"type":20,"value":110},"cl-flet",{"type":15,"tag":42,"props":112,"children":113},{"style":49},[114],{"type":20,"value":115}," ((to-unit (expr unit)\n",{"type":15,"tag":42,"props":117,"children":119},{"class":44,"line":118},3,[120,125],{"type":15,"tag":42,"props":121,"children":122},{"style":49},[123],{"type":20,"value":124},"              (",{"type":15,"tag":42,"props":126,"children":127},{"style":83},[128],{"type":20,"value":129},"string-to-number\n",{"type":15,"tag":42,"props":131,"children":133},{"class":44,"line":132},4,[134,139,144],{"type":15,"tag":42,"props":135,"children":136},{"style":49},[137],{"type":20,"value":138},"               (",{"type":15,"tag":42,"props":140,"children":141},{"style":83},[142],{"type":20,"value":143},"calc-eval",{"type":15,"tag":42,"props":145,"children":146},{"style":49},[147],{"type":20,"value":148}," (math-convert-units\n",{"type":15,"tag":42,"props":150,"children":152},{"class":44,"line":151},5,[153,158,162,167,172],{"type":15,"tag":42,"props":154,"children":155},{"style":49},[156],{"type":20,"value":157},"                           (",{"type":15,"tag":42,"props":159,"children":160},{"style":83},[161],{"type":20,"value":143},{"type":15,"tag":42,"props":163,"children":164},{"style":49},[165],{"type":20,"value":166}," expr ",{"type":15,"tag":42,"props":168,"children":169},{"style":83},[170],{"type":20,"value":171},"'raw",{"type":15,"tag":42,"props":173,"children":174},{"style":49},[175],{"type":20,"value":96},{"type":15,"tag":42,"props":177,"children":179},{"class":44,"line":178},6,[180,184,188,193,197],{"type":15,"tag":42,"props":181,"children":182},{"style":49},[183],{"type":20,"value":157},{"type":15,"tag":42,"props":185,"children":186},{"style":83},[187],{"type":20,"value":143},{"type":15,"tag":42,"props":189,"children":190},{"style":49},[191],{"type":20,"value":192}," unit ",{"type":15,"tag":42,"props":194,"children":195},{"style":83},[196],{"type":20,"value":171},{"type":15,"tag":42,"props":198,"children":199},{"style":49},[200],{"type":20,"value":96},{"type":15,"tag":42,"props":202,"children":204},{"class":44,"line":203},7,[205,210],{"type":15,"tag":42,"props":206,"children":207},{"style":83},[208],{"type":20,"value":209},"                           t",{"type":15,"tag":42,"props":211,"children":212},{"style":49},[213],{"type":20,"value":214},")))))\n",{"type":15,"tag":42,"props":216,"children":218},{"class":44,"line":217},8,[219,224,229],{"type":15,"tag":42,"props":220,"children":221},{"style":49},[222],{"type":20,"value":223},"    (",{"type":15,"tag":42,"props":225,"children":226},{"style":55},[227],{"type":20,"value":228},"let*",{"type":15,"tag":42,"props":230,"children":231},{"style":49},[232],{"type":20,"value":233}," ((region-info-alist\n",{"type":15,"tag":42,"props":235,"children":237},{"class":44,"line":236},9,[238,243,248,253,257,263],{"type":15,"tag":42,"props":239,"children":240},{"style":49},[241],{"type":20,"value":242},"            '((eu ",{"type":15,"tag":42,"props":244,"children":245},{"style":55},[246],{"type":20,"value":247},".",{"type":15,"tag":42,"props":249,"children":250},{"style":49},[251],{"type":20,"value":252}," ((unit ",{"type":15,"tag":42,"props":254,"children":255},{"style":55},[256],{"type":20,"value":247},{"type":15,"tag":42,"props":258,"children":260},{"style":259},"--shiki-default:#9ECBFF",[261],{"type":20,"value":262}," \"cm\"",{"type":15,"tag":42,"props":264,"children":265},{"style":49},[266],{"type":20,"value":96},{"type":15,"tag":42,"props":268,"children":270},{"class":44,"line":269},10,[271,276,280,285,290,295,300,305,310,314,319,323,328,332,337,341,346,350,355],{"type":15,"tag":42,"props":272,"children":273},{"style":49},[274],{"type":20,"value":275},"                     (cups ",{"type":15,"tag":42,"props":277,"children":278},{"style":55},[279],{"type":20,"value":247},{"type":15,"tag":42,"props":281,"children":282},{"style":49},[283],{"type":20,"value":284}," ((",{"type":15,"tag":42,"props":286,"children":287},{"style":83},[288],{"type":20,"value":289},"12",{"type":15,"tag":42,"props":291,"children":292},{"style":55},[293],{"type":20,"value":294}," .",{"type":15,"tag":42,"props":296,"children":297},{"style":259},[298],{"type":20,"value":299}," \"AA\"",{"type":15,"tag":42,"props":301,"children":302},{"style":49},[303],{"type":20,"value":304},") (",{"type":15,"tag":42,"props":306,"children":307},{"style":83},[308],{"type":20,"value":309},"14",{"type":15,"tag":42,"props":311,"children":312},{"style":55},[313],{"type":20,"value":294},{"type":15,"tag":42,"props":315,"children":316},{"style":259},[317],{"type":20,"value":318}," \"A\"",{"type":15,"tag":42,"props":320,"children":321},{"style":49},[322],{"type":20,"value":304},{"type":15,"tag":42,"props":324,"children":325},{"style":83},[326],{"type":20,"value":327},"16",{"type":15,"tag":42,"props":329,"children":330},{"style":55},[331],{"type":20,"value":294},{"type":15,"tag":42,"props":333,"children":334},{"style":259},[335],{"type":20,"value":336}," \"B\"",{"type":15,"tag":42,"props":338,"children":339},{"style":49},[340],{"type":20,"value":304},{"type":15,"tag":42,"props":342,"children":343},{"style":83},[344],{"type":20,"value":345},"18",{"type":15,"tag":42,"props":347,"children":348},{"style":55},[349],{"type":20,"value":294},{"type":15,"tag":42,"props":351,"children":352},{"style":259},[353],{"type":20,"value":354}," \"C\"",{"type":15,"tag":42,"props":356,"children":357},{"style":49},[358],{"type":20,"value":96},{"type":15,"tag":42,"props":360,"children":362},{"class":44,"line":361},11,[363,368,373,377,382,386,391,395,400,404,409,413,418,422,427,431,436],{"type":15,"tag":42,"props":364,"children":365},{"style":49},[366],{"type":20,"value":367},"                              (",{"type":15,"tag":42,"props":369,"children":370},{"style":83},[371],{"type":20,"value":372},"20",{"type":15,"tag":42,"props":374,"children":375},{"style":55},[376],{"type":20,"value":294},{"type":15,"tag":42,"props":378,"children":379},{"style":259},[380],{"type":20,"value":381}," \"D\"",{"type":15,"tag":42,"props":383,"children":384},{"style":49},[385],{"type":20,"value":304},{"type":15,"tag":42,"props":387,"children":388},{"style":83},[389],{"type":20,"value":390},"22",{"type":15,"tag":42,"props":392,"children":393},{"style":55},[394],{"type":20,"value":294},{"type":15,"tag":42,"props":396,"children":397},{"style":259},[398],{"type":20,"value":399}," \"E\"",{"type":15,"tag":42,"props":401,"children":402},{"style":49},[403],{"type":20,"value":304},{"type":15,"tag":42,"props":405,"children":406},{"style":83},[407],{"type":20,"value":408},"24",{"type":15,"tag":42,"props":410,"children":411},{"style":55},[412],{"type":20,"value":294},{"type":15,"tag":42,"props":414,"children":415},{"style":259},[416],{"type":20,"value":417}," \"F\"",{"type":15,"tag":42,"props":419,"children":420},{"style":49},[421],{"type":20,"value":304},{"type":15,"tag":42,"props":423,"children":424},{"style":83},[425],{"type":20,"value":426},"26",{"type":15,"tag":42,"props":428,"children":429},{"style":55},[430],{"type":20,"value":294},{"type":15,"tag":42,"props":432,"children":433},{"style":259},[434],{"type":20,"value":435}," \"G\"",{"type":15,"tag":42,"props":437,"children":438},{"style":49},[439],{"type":20,"value":96},{"type":15,"tag":42,"props":441,"children":443},{"class":44,"line":442},12,[444,448,453,457,462,466,471,475,480,484,489,493,498,502,507,511,516],{"type":15,"tag":42,"props":445,"children":446},{"style":49},[447],{"type":20,"value":367},{"type":15,"tag":42,"props":449,"children":450},{"style":83},[451],{"type":20,"value":452},"28",{"type":15,"tag":42,"props":454,"children":455},{"style":55},[456],{"type":20,"value":294},{"type":15,"tag":42,"props":458,"children":459},{"style":259},[460],{"type":20,"value":461}," \"H\"",{"type":15,"tag":42,"props":463,"children":464},{"style":49},[465],{"type":20,"value":304},{"type":15,"tag":42,"props":467,"children":468},{"style":83},[469],{"type":20,"value":470},"30",{"type":15,"tag":42,"props":472,"children":473},{"style":55},[474],{"type":20,"value":294},{"type":15,"tag":42,"props":476,"children":477},{"style":259},[478],{"type":20,"value":479}," \"I\"",{"type":15,"tag":42,"props":481,"children":482},{"style":49},[483],{"type":20,"value":304},{"type":15,"tag":42,"props":485,"children":486},{"style":83},[487],{"type":20,"value":488},"32",{"type":15,"tag":42,"props":490,"children":491},{"style":55},[492],{"type":20,"value":294},{"type":15,"tag":42,"props":494,"children":495},{"style":259},[496],{"type":20,"value":497}," \"J\"",{"type":15,"tag":42,"props":499,"children":500},{"style":49},[501],{"type":20,"value":304},{"type":15,"tag":42,"props":503,"children":504},{"style":83},[505],{"type":20,"value":506},"34",{"type":15,"tag":42,"props":508,"children":509},{"style":55},[510],{"type":20,"value":294},{"type":15,"tag":42,"props":512,"children":513},{"style":259},[514],{"type":20,"value":515}," \"K\"",{"type":15,"tag":42,"props":517,"children":518},{"style":49},[519],{"type":20,"value":214},{"type":15,"tag":42,"props":521,"children":523},{"class":44,"line":522},13,[524,529,533,537,541,546],{"type":15,"tag":42,"props":525,"children":526},{"style":49},[527],{"type":20,"value":528},"              (uk ",{"type":15,"tag":42,"props":530,"children":531},{"style":55},[532],{"type":20,"value":247},{"type":15,"tag":42,"props":534,"children":535},{"style":49},[536],{"type":20,"value":252},{"type":15,"tag":42,"props":538,"children":539},{"style":55},[540],{"type":20,"value":247},{"type":15,"tag":42,"props":542,"children":543},{"style":259},[544],{"type":20,"value":545}," \"in\"",{"type":15,"tag":42,"props":547,"children":548},{"style":49},[549],{"type":20,"value":96},{"type":15,"tag":42,"props":551,"children":553},{"class":44,"line":552},14,[554,558,562,566,571,575,579,583,588,592,596,600,605,609,613,617,622,626,630],{"type":15,"tag":42,"props":555,"children":556},{"style":49},[557],{"type":20,"value":275},{"type":15,"tag":42,"props":559,"children":560},{"style":55},[561],{"type":20,"value":247},{"type":15,"tag":42,"props":563,"children":564},{"style":49},[565],{"type":20,"value":284},{"type":15,"tag":42,"props":567,"children":568},{"style":83},[569],{"type":20,"value":570},"1",{"type":15,"tag":42,"props":572,"children":573},{"style":55},[574],{"type":20,"value":294},{"type":15,"tag":42,"props":576,"children":577},{"style":259},[578],{"type":20,"value":299},{"type":15,"tag":42,"props":580,"children":581},{"style":49},[582],{"type":20,"value":304},{"type":15,"tag":42,"props":584,"children":585},{"style":83},[586],{"type":20,"value":587},"2",{"type":15,"tag":42,"props":589,"children":590},{"style":55},[591],{"type":20,"value":294},{"type":15,"tag":42,"props":593,"children":594},{"style":259},[595],{"type":20,"value":318},{"type":15,"tag":42,"props":597,"children":598},{"style":49},[599],{"type":20,"value":304},{"type":15,"tag":42,"props":601,"children":602},{"style":83},[603],{"type":20,"value":604},"3",{"type":15,"tag":42,"props":606,"children":607},{"style":55},[608],{"type":20,"value":294},{"type":15,"tag":42,"props":610,"children":611},{"style":259},[612],{"type":20,"value":336},{"type":15,"tag":42,"props":614,"children":615},{"style":49},[616],{"type":20,"value":304},{"type":15,"tag":42,"props":618,"children":619},{"style":83},[620],{"type":20,"value":621},"4",{"type":15,"tag":42,"props":623,"children":624},{"style":55},[625],{"type":20,"value":294},{"type":15,"tag":42,"props":627,"children":628},{"style":259},[629],{"type":20,"value":354},{"type":15,"tag":42,"props":631,"children":632},{"style":49},[633],{"type":20,"value":96},{"type":15,"tag":42,"props":635,"children":637},{"class":44,"line":636},15,[638,642,647,651,655,659,664,668,673,677,682,686,690,694,699,703,707],{"type":15,"tag":42,"props":639,"children":640},{"style":49},[641],{"type":20,"value":367},{"type":15,"tag":42,"props":643,"children":644},{"style":83},[645],{"type":20,"value":646},"5",{"type":15,"tag":42,"props":648,"children":649},{"style":55},[650],{"type":20,"value":294},{"type":15,"tag":42,"props":652,"children":653},{"style":259},[654],{"type":20,"value":381},{"type":15,"tag":42,"props":656,"children":657},{"style":49},[658],{"type":20,"value":304},{"type":15,"tag":42,"props":660,"children":661},{"style":83},[662],{"type":20,"value":663},"6",{"type":15,"tag":42,"props":665,"children":666},{"style":55},[667],{"type":20,"value":294},{"type":15,"tag":42,"props":669,"children":670},{"style":259},[671],{"type":20,"value":672}," \"DD\"",{"type":15,"tag":42,"props":674,"children":675},{"style":49},[676],{"type":20,"value":304},{"type":15,"tag":42,"props":678,"children":679},{"style":83},[680],{"type":20,"value":681},"7",{"type":15,"tag":42,"props":683,"children":684},{"style":55},[685],{"type":20,"value":294},{"type":15,"tag":42,"props":687,"children":688},{"style":259},[689],{"type":20,"value":399},{"type":15,"tag":42,"props":691,"children":692},{"style":49},[693],{"type":20,"value":304},{"type":15,"tag":42,"props":695,"children":696},{"style":83},[697],{"type":20,"value":698},"8",{"type":15,"tag":42,"props":700,"children":701},{"style":55},[702],{"type":20,"value":294},{"type":15,"tag":42,"props":704,"children":705},{"style":259},[706],{"type":20,"value":417},{"type":15,"tag":42,"props":708,"children":709},{"style":49},[710],{"type":20,"value":96},{"type":15,"tag":42,"props":712,"children":714},{"class":44,"line":713},16,[715,719,724,728,733,737,742,746,750,754,759,763,768,772,776,780,784],{"type":15,"tag":42,"props":716,"children":717},{"style":49},[718],{"type":20,"value":367},{"type":15,"tag":42,"props":720,"children":721},{"style":83},[722],{"type":20,"value":723},"9",{"type":15,"tag":42,"props":725,"children":726},{"style":55},[727],{"type":20,"value":294},{"type":15,"tag":42,"props":729,"children":730},{"style":259},[731],{"type":20,"value":732}," \"FF\"",{"type":15,"tag":42,"props":734,"children":735},{"style":49},[736],{"type":20,"value":304},{"type":15,"tag":42,"props":738,"children":739},{"style":83},[740],{"type":20,"value":741},"10",{"type":15,"tag":42,"props":743,"children":744},{"style":55},[745],{"type":20,"value":294},{"type":15,"tag":42,"props":747,"children":748},{"style":259},[749],{"type":20,"value":435},{"type":15,"tag":42,"props":751,"children":752},{"style":49},[753],{"type":20,"value":304},{"type":15,"tag":42,"props":755,"children":756},{"style":83},[757],{"type":20,"value":758},"11",{"type":15,"tag":42,"props":760,"children":761},{"style":55},[762],{"type":20,"value":294},{"type":15,"tag":42,"props":764,"children":765},{"style":259},[766],{"type":20,"value":767}," \"GG\"",{"type":15,"tag":42,"props":769,"children":770},{"style":49},[771],{"type":20,"value":304},{"type":15,"tag":42,"props":773,"children":774},{"style":83},[775],{"type":20,"value":289},{"type":15,"tag":42,"props":777,"children":778},{"style":55},[779],{"type":20,"value":294},{"type":15,"tag":42,"props":781,"children":782},{"style":259},[783],{"type":20,"value":461},{"type":15,"tag":42,"props":785,"children":786},{"style":49},[787],{"type":20,"value":214},{"type":15,"tag":42,"props":789,"children":791},{"class":44,"line":790},17,[792,797,801,805,809,813],{"type":15,"tag":42,"props":793,"children":794},{"style":49},[795],{"type":20,"value":796},"              (us ",{"type":15,"tag":42,"props":798,"children":799},{"style":55},[800],{"type":20,"value":247},{"type":15,"tag":42,"props":802,"children":803},{"style":49},[804],{"type":20,"value":252},{"type":15,"tag":42,"props":806,"children":807},{"style":55},[808],{"type":20,"value":247},{"type":15,"tag":42,"props":810,"children":811},{"style":259},[812],{"type":20,"value":545},{"type":15,"tag":42,"props":814,"children":815},{"style":49},[816],{"type":20,"value":96},{"type":15,"tag":42,"props":818,"children":820},{"class":44,"line":819},18,[821,825,829,833,837,841,845,849,853,857,861,865,869,873,877,881,885,889,893],{"type":15,"tag":42,"props":822,"children":823},{"style":49},[824],{"type":20,"value":275},{"type":15,"tag":42,"props":826,"children":827},{"style":55},[828],{"type":20,"value":247},{"type":15,"tag":42,"props":830,"children":831},{"style":49},[832],{"type":20,"value":284},{"type":15,"tag":42,"props":834,"children":835},{"style":83},[836],{"type":20,"value":570},{"type":15,"tag":42,"props":838,"children":839},{"style":55},[840],{"type":20,"value":294},{"type":15,"tag":42,"props":842,"children":843},{"style":259},[844],{"type":20,"value":299},{"type":15,"tag":42,"props":846,"children":847},{"style":49},[848],{"type":20,"value":304},{"type":15,"tag":42,"props":850,"children":851},{"style":83},[852],{"type":20,"value":587},{"type":15,"tag":42,"props":854,"children":855},{"style":55},[856],{"type":20,"value":294},{"type":15,"tag":42,"props":858,"children":859},{"style":259},[860],{"type":20,"value":318},{"type":15,"tag":42,"props":862,"children":863},{"style":49},[864],{"type":20,"value":304},{"type":15,"tag":42,"props":866,"children":867},{"style":83},[868],{"type":20,"value":604},{"type":15,"tag":42,"props":870,"children":871},{"style":55},[872],{"type":20,"value":294},{"type":15,"tag":42,"props":874,"children":875},{"style":259},[876],{"type":20,"value":336},{"type":15,"tag":42,"props":878,"children":879},{"style":49},[880],{"type":20,"value":304},{"type":15,"tag":42,"props":882,"children":883},{"style":83},[884],{"type":20,"value":621},{"type":15,"tag":42,"props":886,"children":887},{"style":55},[888],{"type":20,"value":294},{"type":15,"tag":42,"props":890,"children":891},{"style":259},[892],{"type":20,"value":354},{"type":15,"tag":42,"props":894,"children":895},{"style":49},[896],{"type":20,"value":96},{"type":15,"tag":42,"props":898,"children":900},{"class":44,"line":899},19,[901,905,909,913,917,921,925,929,934,938,942,946,951,955,959,963,968],{"type":15,"tag":42,"props":902,"children":903},{"style":49},[904],{"type":20,"value":367},{"type":15,"tag":42,"props":906,"children":907},{"style":83},[908],{"type":20,"value":646},{"type":15,"tag":42,"props":910,"children":911},{"style":55},[912],{"type":20,"value":294},{"type":15,"tag":42,"props":914,"children":915},{"style":259},[916],{"type":20,"value":381},{"type":15,"tag":42,"props":918,"children":919},{"style":49},[920],{"type":20,"value":304},{"type":15,"tag":42,"props":922,"children":923},{"style":83},[924],{"type":20,"value":663},{"type":15,"tag":42,"props":926,"children":927},{"style":55},[928],{"type":20,"value":294},{"type":15,"tag":42,"props":930,"children":931},{"style":259},[932],{"type":20,"value":933}," \"DD/E\"",{"type":15,"tag":42,"props":935,"children":936},{"style":49},[937],{"type":20,"value":304},{"type":15,"tag":42,"props":939,"children":940},{"style":83},[941],{"type":20,"value":681},{"type":15,"tag":42,"props":943,"children":944},{"style":55},[945],{"type":20,"value":294},{"type":15,"tag":42,"props":947,"children":948},{"style":259},[949],{"type":20,"value":950}," \"DDD/F\"",{"type":15,"tag":42,"props":952,"children":953},{"style":49},[954],{"type":20,"value":304},{"type":15,"tag":42,"props":956,"children":957},{"style":83},[958],{"type":20,"value":698},{"type":15,"tag":42,"props":960,"children":961},{"style":55},[962],{"type":20,"value":294},{"type":15,"tag":42,"props":964,"children":965},{"style":259},[966],{"type":20,"value":967}," \"DDDD/G\"",{"type":15,"tag":42,"props":969,"children":970},{"style":49},[971],{"type":20,"value":96},{"type":15,"tag":42,"props":973,"children":975},{"class":44,"line":974},20,[976,980,984,988,992,996,1000,1004,1008,1012,1016,1020,1024,1028,1032,1036,1040],{"type":15,"tag":42,"props":977,"children":978},{"style":49},[979],{"type":20,"value":367},{"type":15,"tag":42,"props":981,"children":982},{"style":83},[983],{"type":20,"value":723},{"type":15,"tag":42,"props":985,"children":986},{"style":55},[987],{"type":20,"value":294},{"type":15,"tag":42,"props":989,"children":990},{"style":259},[991],{"type":20,"value":461},{"type":15,"tag":42,"props":993,"children":994},{"style":49},[995],{"type":20,"value":304},{"type":15,"tag":42,"props":997,"children":998},{"style":83},[999],{"type":20,"value":741},{"type":15,"tag":42,"props":1001,"children":1002},{"style":55},[1003],{"type":20,"value":294},{"type":15,"tag":42,"props":1005,"children":1006},{"style":259},[1007],{"type":20,"value":479},{"type":15,"tag":42,"props":1009,"children":1010},{"style":49},[1011],{"type":20,"value":304},{"type":15,"tag":42,"props":1013,"children":1014},{"style":83},[1015],{"type":20,"value":758},{"type":15,"tag":42,"props":1017,"children":1018},{"style":55},[1019],{"type":20,"value":294},{"type":15,"tag":42,"props":1021,"children":1022},{"style":259},[1023],{"type":20,"value":497},{"type":15,"tag":42,"props":1025,"children":1026},{"style":49},[1027],{"type":20,"value":304},{"type":15,"tag":42,"props":1029,"children":1030},{"style":83},[1031],{"type":20,"value":289},{"type":15,"tag":42,"props":1033,"children":1034},{"style":55},[1035],{"type":20,"value":294},{"type":15,"tag":42,"props":1037,"children":1038},{"style":259},[1039],{"type":20,"value":515},{"type":15,"tag":42,"props":1041,"children":1042},{"style":49},[1043],{"type":20,"value":1044},")))))))\n",{"type":15,"tag":42,"props":1046,"children":1048},{"class":44,"line":1047},21,[1049,1054,1059,1063,1068,1072,1077],{"type":15,"tag":42,"props":1050,"children":1051},{"style":49},[1052],{"type":20,"value":1053},"           (",{"type":15,"tag":42,"props":1055,"children":1056},{"style":83},[1057],{"type":20,"value":1058},"region",{"type":15,"tag":42,"props":1060,"children":1061},{"style":49},[1062],{"type":20,"value":69},{"type":15,"tag":42,"props":1064,"children":1065},{"style":55},[1066],{"type":20,"value":1067},"or",{"type":15,"tag":42,"props":1069,"children":1070},{"style":83},[1071],{"type":20,"value":91},{"type":15,"tag":42,"props":1073,"children":1074},{"style":83},[1075],{"type":20,"value":1076}," 'eu",{"type":15,"tag":42,"props":1078,"children":1079},{"style":49},[1080],{"type":20,"value":1081},"))\n",{"type":15,"tag":42,"props":1083,"children":1085},{"class":44,"line":1084},22,[1086,1091,1096,1100],{"type":15,"tag":42,"props":1087,"children":1088},{"style":49},[1089],{"type":20,"value":1090},"           (region-info (",{"type":15,"tag":42,"props":1092,"children":1093},{"style":83},[1094],{"type":20,"value":1095},"alist-get",{"type":15,"tag":42,"props":1097,"children":1098},{"style":83},[1099],{"type":20,"value":91},{"type":15,"tag":42,"props":1101,"children":1102},{"style":49},[1103],{"type":20,"value":1104}," region-info-alist))\n",{"type":15,"tag":42,"props":1106,"children":1108},{"class":44,"line":1107},23,[1109,1114,1118,1123],{"type":15,"tag":42,"props":1110,"children":1111},{"style":49},[1112],{"type":20,"value":1113},"           (unit (",{"type":15,"tag":42,"props":1115,"children":1116},{"style":83},[1117],{"type":20,"value":1095},{"type":15,"tag":42,"props":1119,"children":1120},{"style":83},[1121],{"type":20,"value":1122}," 'unit",{"type":15,"tag":42,"props":1124,"children":1125},{"style":49},[1126],{"type":20,"value":1127}," region-info))\n",{"type":15,"tag":42,"props":1129,"children":1131},{"class":44,"line":1130},24,[1132,1137,1141,1146],{"type":15,"tag":42,"props":1133,"children":1134},{"style":49},[1135],{"type":20,"value":1136},"           (cups (",{"type":15,"tag":42,"props":1138,"children":1139},{"style":83},[1140],{"type":20,"value":1095},{"type":15,"tag":42,"props":1142,"children":1143},{"style":83},[1144],{"type":20,"value":1145}," 'cups",{"type":15,"tag":42,"props":1147,"children":1148},{"style":49},[1149],{"type":20,"value":1127},{"type":15,"tag":42,"props":1151,"children":1153},{"class":44,"line":1152},25,[1154],{"type":15,"tag":42,"props":1155,"children":1156},{"style":49},[1157],{"type":20,"value":1158},"           (band (to-unit band-expr unit))\n",{"type":15,"tag":42,"props":1160,"children":1162},{"class":44,"line":1161},26,[1163],{"type":15,"tag":42,"props":1164,"children":1165},{"style":49},[1166],{"type":20,"value":1167},"           (bust (to-unit bust-expr unit))\n",{"type":15,"tag":42,"props":1169,"children":1171},{"class":44,"line":1170},27,[1172,1176,1181,1185,1190],{"type":15,"tag":42,"props":1173,"children":1174},{"style":49},[1175],{"type":20,"value":1053},{"type":15,"tag":42,"props":1177,"children":1178},{"style":83},[1179],{"type":20,"value":1180},"diff",{"type":15,"tag":42,"props":1182,"children":1183},{"style":49},[1184],{"type":20,"value":69},{"type":15,"tag":42,"props":1186,"children":1187},{"style":55},[1188],{"type":20,"value":1189},"-",{"type":15,"tag":42,"props":1191,"children":1192},{"style":49},[1193],{"type":20,"value":1194}," bust band))\n",{"type":15,"tag":42,"props":1196,"children":1198},{"class":44,"line":1197},28,[1199,1204,1208,1212,1217,1221,1226,1230,1235,1239,1244,1248,1253,1258,1263],{"type":15,"tag":42,"props":1200,"children":1201},{"style":49},[1202],{"type":20,"value":1203},"           (cup (",{"type":15,"tag":42,"props":1205,"children":1206},{"style":55},[1207],{"type":20,"value":1067},{"type":15,"tag":42,"props":1209,"children":1210},{"style":49},[1211],{"type":20,"value":69},{"type":15,"tag":42,"props":1213,"children":1214},{"style":55},[1215],{"type":20,"value":1216},"cdr",{"type":15,"tag":42,"props":1218,"children":1219},{"style":49},[1220],{"type":20,"value":69},{"type":15,"tag":42,"props":1222,"children":1223},{"style":83},[1224],{"type":20,"value":1225},"seq-find",{"type":15,"tag":42,"props":1227,"children":1228},{"style":49},[1229],{"type":20,"value":69},{"type":15,"tag":42,"props":1231,"children":1232},{"style":55},[1233],{"type":20,"value":1234},"lambda",{"type":15,"tag":42,"props":1236,"children":1237},{"style":49},[1238],{"type":20,"value":69},{"type":15,"tag":42,"props":1240,"children":1241},{"style":72},[1242],{"type":20,"value":1243},"x",{"type":15,"tag":42,"props":1245,"children":1246},{"style":49},[1247],{"type":20,"value":304},{"type":15,"tag":42,"props":1249,"children":1250},{"style":55},[1251],{"type":20,"value":1252},"\u003C",{"type":15,"tag":42,"props":1254,"children":1255},{"style":49},[1256],{"type":20,"value":1257}," diff (",{"type":15,"tag":42,"props":1259,"children":1260},{"style":55},[1261],{"type":20,"value":1262},"car",{"type":15,"tag":42,"props":1264,"children":1265},{"style":49},[1266],{"type":20,"value":1267}," x))) cups))\n",{"type":15,"tag":42,"props":1269,"children":1271},{"class":44,"line":1270},29,[1272,1277,1282,1287,1292,1297,1301,1306,1310,1315,1320],{"type":15,"tag":42,"props":1273,"children":1274},{"style":49},[1275],{"type":20,"value":1276},"                    (",{"type":15,"tag":42,"props":1278,"children":1279},{"style":83},[1280],{"type":20,"value":1281},"format",{"type":15,"tag":42,"props":1283,"children":1284},{"style":259},[1285],{"type":20,"value":1286}," \"",{"type":15,"tag":42,"props":1288,"children":1289},{"style":83},[1290],{"type":20,"value":1291},"%s",{"type":15,"tag":42,"props":1293,"children":1294},{"style":259},[1295],{"type":20,"value":1296},"+\"",{"type":15,"tag":42,"props":1298,"children":1299},{"style":49},[1300],{"type":20,"value":69},{"type":15,"tag":42,"props":1302,"children":1303},{"style":55},[1304],{"type":20,"value":1305},"cdar",{"type":15,"tag":42,"props":1307,"children":1308},{"style":49},[1309],{"type":20,"value":69},{"type":15,"tag":42,"props":1311,"children":1312},{"style":55},[1313],{"type":20,"value":1314},"last",{"type":15,"tag":42,"props":1316,"children":1317},{"style":49},[1318],{"type":20,"value":1319}," cups)))",{"type":15,"tag":42,"props":1321,"children":1322},{"style":49},[1323],{"type":20,"value":1324},")))\n",{"type":15,"tag":42,"props":1326,"children":1328},{"class":44,"line":1327},30,[1329,1334,1338,1342,1347,1352,1356,1361,1366],{"type":15,"tag":42,"props":1330,"children":1331},{"style":49},[1332],{"type":20,"value":1333},"      (",{"type":15,"tag":42,"props":1335,"children":1336},{"style":83},[1337],{"type":20,"value":1281},{"type":15,"tag":42,"props":1339,"children":1340},{"style":259},[1341],{"type":20,"value":1286},{"type":15,"tag":42,"props":1343,"children":1344},{"style":83},[1345],{"type":20,"value":1346},"%s%s",{"type":15,"tag":42,"props":1348,"children":1349},{"style":259},[1350],{"type":20,"value":1351},"\"",{"type":15,"tag":42,"props":1353,"children":1354},{"style":49},[1355],{"type":20,"value":69},{"type":15,"tag":42,"props":1357,"children":1358},{"style":83},[1359],{"type":20,"value":1360},"round",{"type":15,"tag":42,"props":1362,"children":1363},{"style":49},[1364],{"type":20,"value":1365}," band) cup diff)",{"type":15,"tag":42,"props":1367,"children":1368},{"style":49},[1369],{"type":20,"value":1324},{"type":15,"tag":16,"props":1371,"children":1372},{},[1373],{"type":20,"value":1374},"this makes use of Emacs Calc's built-in unit conversion functions, so you need to pass in the measurements as unit-suffixed strings. for example, given a made-up band (underbust) measurement of 90 cm and a bust measurement of 105 cm, you could calculate the EU bra size as",{"type":15,"tag":32,"props":1376,"children":1378},{"className":34,"code":1377,"language":36,"meta":7,"style":7},"(my-math-compute-bra-size \"90 cm\" \"105 cm\" 'eu)\n",[1379],{"type":15,"tag":23,"props":1380,"children":1381},{"__ignoreMap":7},[1382],{"type":15,"tag":42,"props":1383,"children":1384},{"class":44,"line":45},[1385,1390,1395,1400,1404],{"type":15,"tag":42,"props":1386,"children":1387},{"style":49},[1388],{"type":20,"value":1389},"(my-math-compute-bra-size ",{"type":15,"tag":42,"props":1391,"children":1392},{"style":259},[1393],{"type":20,"value":1394},"\"90 cm\"",{"type":15,"tag":42,"props":1396,"children":1397},{"style":259},[1398],{"type":20,"value":1399}," \"105 cm\"",{"type":15,"tag":42,"props":1401,"children":1402},{"style":83},[1403],{"type":20,"value":1076},{"type":15,"tag":42,"props":1405,"children":1406},{"style":49},[1407],{"type":20,"value":96},{"type":15,"tag":16,"props":1409,"children":1410},{},[1411,1413,1419,1421,1427,1429,1435,1437,1443],{"type":20,"value":1412},"giving ",{"type":15,"tag":23,"props":1414,"children":1416},{"className":1415},[],[1417],{"type":20,"value":1418},"\"90B\"",{"type":20,"value":1420},". you could also use other units of length, such as ",{"type":15,"tag":23,"props":1422,"children":1424},{"className":1423},[],[1425],{"type":20,"value":1426},"in",{"type":20,"value":1428}," (inches), or ",{"type":15,"tag":23,"props":1430,"children":1432},{"className":1431},[],[1433],{"type":20,"value":1434},"ly",{"type":20,"value":1436}," (light years), or ",{"type":15,"tag":23,"props":1438,"children":1440},{"className":1439},[],[1441],{"type":20,"value":1442},"Ang",{"type":20,"value":1444}," (Angstrom). hooray for Calc!",{"type":15,"tag":16,"props":1446,"children":1447},{},[1448,1450,1459],{"type":20,"value":1449},"we can take this further with some nice UI around it. i have recently enjoyed using ",{"type":15,"tag":1451,"props":1452,"children":1456},"a",{"href":1453,"rel":1454},"https://orgmode.org/worg/org-tutorials/org-spreadsheet-intro.html",[1455],"nofollow",[1457],{"type":20,"value":1458},"Org tables as spreadsheets",{"type":20,"value":1460},", and wanted to make a table where i can just type in my measurements, refresh, and have EU/UK/US bra sizes automatically filled in.",{"type":15,"tag":16,"props":1462,"children":1463},{},[1464,1466,1473],{"type":20,"value":1465},"this is not too difficult to achieve by ",{"type":15,"tag":1451,"props":1467,"children":1470},{"href":1468,"rel":1469},"https://orgmode.org/worg/org-tutorials/org-spreadsheet-lisp-formulas.html",[1455],[1471],{"type":20,"value":1472},"using Emacs Lisp as formulas",{"type":20,"value":1474},". you can copy-paste the following table as a template:",{"type":15,"tag":32,"props":1476,"children":1480},{"className":1477,"code":1478,"language":1479,"meta":7,"style":7},"language-orgmode shiki shiki-themes github-dark","|       date | band  | bust   | EU size | UK size | US size |\n|------------+-------+--------+---------+---------+---------|\n| 2026-05-27 | 90 cm | 105 cm |         |         |         |\n#+TBLFM: $4='(my-math-compute-bra-size $2 $3 'eu)::$5='(my-math-compute-bra-size $2 $3 'uk)::$6='(my-math-compute-bra-size $2 $3 'us)\n","orgmode",[1481],{"type":15,"tag":23,"props":1482,"children":1483},{"__ignoreMap":7},[1484,1492,1500,1508],{"type":15,"tag":42,"props":1485,"children":1486},{"class":44,"line":45},[1487],{"type":15,"tag":42,"props":1488,"children":1489},{},[1490],{"type":20,"value":1491},"|       date | band  | bust   | EU size | UK size | US size |\n",{"type":15,"tag":42,"props":1493,"children":1494},{"class":44,"line":99},[1495],{"type":15,"tag":42,"props":1496,"children":1497},{},[1498],{"type":20,"value":1499},"|------------+-------+--------+---------+---------+---------|\n",{"type":15,"tag":42,"props":1501,"children":1502},{"class":44,"line":118},[1503],{"type":15,"tag":42,"props":1504,"children":1505},{},[1506],{"type":20,"value":1507},"| 2026-05-27 | 90 cm | 105 cm |         |         |         |\n",{"type":15,"tag":42,"props":1509,"children":1510},{"class":44,"line":132},[1511],{"type":15,"tag":42,"props":1512,"children":1513},{},[1514],{"type":20,"value":1515},"#+TBLFM: $4='(my-math-compute-bra-size $2 $3 'eu)::$5='(my-math-compute-bra-size $2 $3 'uk)::$6='(my-math-compute-bra-size $2 $3 'us)\n",{"type":15,"tag":16,"props":1517,"children":1518},{},[1519,1521,1528,1530,1536],{"type":20,"value":1520},"modify the band and bust numbers (again, with your preferred length units!), ",{"type":15,"tag":1451,"props":1522,"children":1525},{"href":1523,"rel":1524},"https://orgmode.org/manual/Updating-the-table.html",[1455],[1526],{"type":20,"value":1527},"update the table",{"type":20,"value":1529},", for example with ",{"type":15,"tag":23,"props":1531,"children":1533},{"className":1532},[],[1534],{"type":20,"value":1535},"C-u C-c *",{"type":20,"value":1537},", and all the size fields get recomputed :) you can also add more rows and keep a log of measurements over time, if you want to.",{"type":15,"tag":16,"props":1539,"children":1540},{},[1541],{"type":20,"value":1542},"disclaimers:",{"type":15,"tag":1544,"props":1545,"children":1546},"ul",{},[1547,1553,1566],{"type":15,"tag":1548,"props":1549,"children":1550},"li",{},[1551],{"type":20,"value":1552},"i implemented support for EU, UK and US sizing as these are the ones i usually encounter. other standards might need some additional logic.",{"type":15,"tag":1548,"props":1554,"children":1555},{},[1556,1558,1564],{"type":20,"value":1557},"there are larger cup sizes than the ones i entered, but the data i found on them was a bit inconsistent. sorry! for sizes that are out of range, the function will return the largest known size with a ",{"type":15,"tag":23,"props":1559,"children":1561},{"className":1560},[],[1562],{"type":20,"value":1563},"+",{"type":20,"value":1565}," added. it should hopefully be easy to augment the data if needed.",{"type":15,"tag":1548,"props":1567,"children":1568},{},[1569,1571],{"type":20,"value":1570},"there may be mistakes in my data/code.\n",{"type":15,"tag":1544,"props":1572,"children":1573},{},[1574,1579],{"type":15,"tag":1548,"props":1575,"children":1576},{},[1577],{"type":20,"value":1578},"i know in practice sizes vary by brand, model, etc. but results from online calculators that i tried while writing this post vary so wildly that i now question whether these numbers really mean anything at all.",{"type":15,"tag":1548,"props":1580,"children":1581},{},[1582,1584,1591],{"type":20,"value":1583},"i am reasonably confident my EU size calculation is consistent with ",{"type":15,"tag":1451,"props":1585,"children":1588},{"href":1586,"rel":1587},"https://en.wikipedia.org/wiki/Joint_European_standard_for_size_labelling_of_clothes#Bra_sizes",[1455],[1589],{"type":20,"value":1590},"EN 13402",{"type":20,"value":1592}," though.",{"type":15,"tag":1594,"props":1595,"children":1596},"style",{},[1597],{"type":20,"value":1598},"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);}",{"title":7,"searchDepth":99,"depth":99,"links":1600},[],"markdown","content:blog:emacs-bra-size-calculator.md","content","blog/emacs-bra-size-calculator.md","blog/emacs-bra-size-calculator","md",1779922895122]