3 ms·
Yes, arbitrary precision integers could theoretically become a C language/library feature. But let's say that it gets proposed and accepted and it's integrated
by wyldfire 5y ago
Yes, arbitrary precision integers could theoretically become a C language/library feature. But let's say that it gets proposed and accepted and it's integrated into popular compiler toolchains. The kernel wouldn't leverage it here or likely anywhere else because of its cost.
A newly designed OS kernel could perhaps take on this kind of feature. This would be the kind of OS that could be formally verified and would be willing to pay that runtime cost for arbitrary precision.
- airocker 5y agoPerhaps such type of things have been put in Kernel before.
- kaba0 5y agoC doesn’t have the abstraction power to make anything with such a datatype.
- wyldfire 5y agoI left myself a lot of latitude when I referred to this as a potential "language/library feature". typedef struct { /* TODO */ } arb_int; arb_int *new_arb_int(void); void delete_arb_int(arb_int *); arb_int *arb_int_add(arb_int *, arb_int *); arb_int *arb_int_sub(arb_int *, arb_int *); arb_int *arb_int_mul(arb_int *, arb_int *); arb_int *arb_int_div(arb_int *, arb_int *); bool arb_int_gt(arb_int *, arb_int *); bool arb_int_lt(arb_int *, arb_int *); bool arb_int_gte(arb_int *, arb_int *); bool arb_int_lte(arb_int *, arb_int *); bool arb_int_eq(arb_int *, arb_int *);