lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

net_line_v1.json (6936B)


      1 {
      2   "schema_version": 1,
      3   "profile": "half_even_net_line_v1",
      4   "provenance": {
      5     "source": "Radroots synthetic fixed-price design vectors",
      6     "source_sha256": "cbfe6a7ba97d1825bbaf62e82bb3a591f3d2f09f7352e2af9c433f392234a5e6",
      7     "original_vectors": 10,
      8     "additional_vectors": 16,
      9     "expected_values": "independent Python Fraction and Decimal precision120 agreement"
     10   },
     11   "vectors": [
     12     {
     13       "id": "net-line-tie-even",
     14       "rate_minor": "325",
     15       "quantity": "2.5",
     16       "basis": "1",
     17       "discount_bps": 0,
     18       "expected_minor": "812",
     19       "expected_error": null,
     20       "unbounded_rounded_minor": "812"
     21     },
     22     {
     23       "id": "net-line-tie-odd",
     24       "rate_minor": "327",
     25       "quantity": "2.5",
     26       "basis": "1",
     27       "discount_bps": 0,
     28       "expected_minor": "818",
     29       "expected_error": null,
     30       "unbounded_rounded_minor": "818"
     31     },
     32     {
     33       "id": "half-cent-even",
     34       "rate_minor": "101",
     35       "quantity": "0.5",
     36       "basis": "1",
     37       "discount_bps": 0,
     38       "expected_minor": "50",
     39       "expected_error": null,
     40       "unbounded_rounded_minor": "50"
     41     },
     42     {
     43       "id": "half-cent-odd",
     44       "rate_minor": "103",
     45       "quantity": "0.5",
     46       "basis": "1",
     47       "discount_bps": 0,
     48       "expected_minor": "52",
     49       "expected_error": null,
     50       "unbounded_rounded_minor": "52"
     51     },
     52     {
     53       "id": "discount-before-one-round",
     54       "rate_minor": "299",
     55       "quantity": "3.5",
     56       "basis": "1",
     57       "discount_bps": 1000,
     58       "expected_minor": "942",
     59       "expected_error": null,
     60       "unbounded_rounded_minor": "942"
     61     },
     62     {
     63       "id": "free-is-valid",
     64       "rate_minor": "0",
     65       "quantity": "2",
     66       "basis": "1",
     67       "discount_bps": 0,
     68       "expected_minor": "0",
     69       "expected_error": null,
     70       "unbounded_rounded_minor": "0"
     71     },
     72     {
     73       "id": "case-price",
     74       "rate_minor": "2450",
     75       "quantity": "3",
     76       "basis": "1",
     77       "discount_bps": 0,
     78       "expected_minor": "7350",
     79       "expected_error": null,
     80       "unbounded_rounded_minor": "7350"
     81     },
     82     {
     83       "id": "per-100-grams",
     84       "rate_minor": "175",
     85       "quantity": "250",
     86       "basis": "100",
     87       "discount_bps": 0,
     88       "expected_minor": "438",
     89       "expected_error": null,
     90       "unbounded_rounded_minor": "438"
     91     },
     92     {
     93       "id": "large-exact-intermediate-beyond-js-safe",
     94       "rate_minor": "999999999999999",
     95       "quantity": "999999999999",
     96       "basis": "999999999999",
     97       "discount_bps": 0,
     98       "expected_minor": "999999999999999",
     99       "expected_error": null,
    100       "unbounded_rounded_minor": "999999999999999"
    101     },
    102     {
    103       "id": "full-discount",
    104       "rate_minor": "999",
    105       "quantity": "5",
    106       "basis": "1",
    107       "discount_bps": 10000,
    108       "expected_minor": "0",
    109       "expected_error": null,
    110       "unbounded_rounded_minor": "0"
    111     },
    112     {
    113       "id": "boundary-00",
    114       "rate_minor": "1",
    115       "quantity": "0.499999",
    116       "basis": "1",
    117       "discount_bps": 0,
    118       "expected_minor": "0",
    119       "expected_error": null,
    120       "unbounded_rounded_minor": "0"
    121     },
    122     {
    123       "id": "boundary-01",
    124       "rate_minor": "1",
    125       "quantity": "0.500001",
    126       "basis": "1",
    127       "discount_bps": 0,
    128       "expected_minor": "1",
    129       "expected_error": null,
    130       "unbounded_rounded_minor": "1"
    131     },
    132     {
    133       "id": "boundary-02",
    134       "rate_minor": "1",
    135       "quantity": "0.5",
    136       "basis": "1",
    137       "discount_bps": 0,
    138       "expected_minor": "0",
    139       "expected_error": null,
    140       "unbounded_rounded_minor": "0"
    141     },
    142     {
    143       "id": "boundary-03",
    144       "rate_minor": "3",
    145       "quantity": "0.5",
    146       "basis": "1",
    147       "discount_bps": 0,
    148       "expected_minor": "2",
    149       "expected_error": null,
    150       "unbounded_rounded_minor": "2"
    151     },
    152     {
    153       "id": "boundary-04",
    154       "rate_minor": "325",
    155       "quantity": "0.000001",
    156       "basis": "0.000001",
    157       "discount_bps": 1,
    158       "expected_minor": "325",
    159       "expected_error": null,
    160       "unbounded_rounded_minor": "325"
    161     },
    162     {
    163       "id": "boundary-05",
    164       "rate_minor": "999999999999999",
    165       "quantity": "999999999999",
    166       "basis": "999999999999",
    167       "discount_bps": 1,
    168       "expected_minor": "999899999999999",
    169       "expected_error": null,
    170       "unbounded_rounded_minor": "999899999999999"
    171     },
    172     {
    173       "id": "boundary-06",
    174       "rate_minor": "999999999999999",
    175       "quantity": "999999999999",
    176       "basis": "0.000001",
    177       "discount_bps": 0,
    178       "expected_minor": null,
    179       "expected_error": "minor_out_of_range",
    180       "unbounded_rounded_minor": "999999999998999000000000001000000"
    181     },
    182     {
    183       "id": "boundary-07",
    184       "rate_minor": "999999999999999",
    185       "quantity": "999999999999",
    186       "basis": "0.000001",
    187       "discount_bps": 10000,
    188       "expected_minor": "0",
    189       "expected_error": null,
    190       "unbounded_rounded_minor": "0"
    191     },
    192     {
    193       "id": "boundary-08",
    194       "rate_minor": "999999999999999",
    195       "quantity": "0.000001",
    196       "basis": "999999999999",
    197       "discount_bps": 0,
    198       "expected_minor": "0",
    199       "expected_error": null,
    200       "unbounded_rounded_minor": "0"
    201     },
    202     {
    203       "id": "boundary-09",
    204       "rate_minor": "101",
    205       "quantity": "1.5",
    206       "basis": "0.1",
    207       "discount_bps": 1000,
    208       "expected_minor": "1364",
    209       "expected_error": null,
    210       "unbounded_rounded_minor": "1364"
    211     },
    212     {
    213       "id": "boundary-10",
    214       "rate_minor": "103",
    215       "quantity": "2.5",
    216       "basis": "0.1",
    217       "discount_bps": 9999,
    218       "expected_minor": "0",
    219       "expected_error": null,
    220       "unbounded_rounded_minor": "0"
    221     },
    222     {
    223       "id": "boundary-11",
    224       "rate_minor": "175",
    225       "quantity": "250",
    226       "basis": "100",
    227       "discount_bps": 1000,
    228       "expected_minor": "394",
    229       "expected_error": null,
    230       "unbounded_rounded_minor": "394"
    231     },
    232     {
    233       "id": "boundary-12",
    234       "rate_minor": "333",
    235       "quantity": "1",
    236       "basis": "3",
    237       "discount_bps": 1,
    238       "expected_minor": "111",
    239       "expected_error": null,
    240       "unbounded_rounded_minor": "111"
    241     },
    242     {
    243       "id": "boundary-13",
    244       "rate_minor": "1",
    245       "quantity": "999999999999",
    246       "basis": "0.000001",
    247       "discount_bps": 0,
    248       "expected_minor": null,
    249       "expected_error": "minor_out_of_range",
    250       "unbounded_rounded_minor": "999999999999000000"
    251     },
    252     {
    253       "id": "boundary-14",
    254       "rate_minor": "100",
    255       "quantity": "1",
    256       "basis": "0.000003",
    257       "discount_bps": 0,
    258       "expected_minor": "33333333",
    259       "expected_error": null,
    260       "unbounded_rounded_minor": "33333333"
    261     },
    262     {
    263       "id": "boundary-15",
    264       "rate_minor": "0",
    265       "quantity": "999999999999",
    266       "basis": "0.000001",
    267       "discount_bps": 0,
    268       "expected_minor": "0",
    269       "expected_error": null,
    270       "unbounded_rounded_minor": "0"
    271     }
    272   ]
    273 }