Lines Matching defs:BcNum

113 typedef struct BcNum
141 } BcNum;
176 // the size required for ibase and obase BcNum's.
180 * Returns non-zero if the BcNum @a n is non-zero.
187 * Returns true if the BcNum @a n is zero.
194 * Returns true if the BcNum @a n is one with no scale.
371 typedef void (*BcNumBinaryOp)(BcNum* a, BcNum* b, BcNum* c, size_t scale);
382 typedef void (*BcNumBinOp)(BcNum* a, BcNum* b, BcNum* restrict c, size_t scale);
394 typedef size_t (*BcNumBinaryOpReq)(const BcNum* a, const BcNum* b,
426 bc_num_init(BcNum* restrict n, size_t req);
437 bc_num_setup(BcNum* restrict n, BcDig* restrict num, size_t cap);
441 * already a valid and allocated BcNum.
442 * @param d The destination BcNum.
443 * @param s The source BcNum.
446 bc_num_copy(BcNum* d, const BcNum* s);
450 * that @a d is *not* a valid or allocated BcNum.
451 * @param d The destination BcNum.
452 * @param s The source BcNum.
455 bc_num_createCopy(BcNum* d, const BcNum* s);
459 * @a n must *not* be a valid or preallocated BcNum.
464 bc_num_createFromBigdig(BcNum* restrict n, BcBigDig val);
472 bc_num_clear(BcNum* restrict n);
475 * Frees @a num, which is a BcNum as a void pointer. This is a destructor.
476 * @param num The BcNum to free as a void pointer.
487 bc_num_scale(const BcNum* restrict n);
498 bc_num_len(const BcNum* restrict n);
508 bc_num_bigdig(const BcNum* restrict n);
517 bc_num_bigdig2(const BcNum* restrict n);
521 * allocated BcNum.
526 bc_num_bigdig2num(BcNum* restrict n, BcBigDig val);
538 bc_num_irand(BcNum* restrict a, BcNum* restrict b, struct BcRNG* restrict rng);
546 bc_num_rng(const BcNum* restrict n, struct BcRNG* rng);
554 bc_num_createFromRNG(BcNum* restrict n, struct BcRNG* rng);
566 bc_num_add(BcNum* a, BcNum* b, BcNum* c, size_t scale);
576 bc_num_sub(BcNum* a, BcNum* b, BcNum* c, size_t scale);
586 bc_num_mul(BcNum* a, BcNum* b, BcNum* c, size_t scale);
596 bc_num_div(BcNum* a, BcNum* b, BcNum* c, size_t scale);
606 bc_num_mod(BcNum* a, BcNum* b, BcNum* c, size_t scale);
616 bc_num_pow(BcNum* a, BcNum* b, BcNum* c, size_t scale);
627 bc_num_places(BcNum* a, BcNum* b, BcNum* c, size_t scale);
637 bc_num_lshift(BcNum* a, BcNum* b, BcNum* c, size_t scale);
647 bc_num_rshift(BcNum* a, BcNum* b, BcNum* c, size_t scale);
658 bc_num_sqrt(BcNum* restrict a, BcNum* restrict b, size_t scale);
669 bc_num_divmod(BcNum* a, BcNum* b, BcNum* c, BcNum* d, size_t scale);
681 bc_num_addReq(const BcNum* a, const BcNum* b, size_t scale);
693 bc_num_mulReq(const BcNum* a, const BcNum* b, size_t scale);
705 bc_num_divReq(const BcNum* a, const BcNum* b, size_t scale);
717 bc_num_powReq(const BcNum* a, const BcNum* b, size_t scale);
731 bc_num_placesReq(const BcNum* a, const BcNum* b, size_t scale);
742 bc_num_truncate(BcNum* restrict n, size_t places);
751 bc_num_extend(BcNum* restrict n, size_t places);
761 bc_num_shiftRight(BcNum* restrict n, size_t places);
772 bc_num_cmp(const BcNum* a, const BcNum* b);
782 bc_num_modexp(BcNum* a, BcNum* b, BcNum* c, BcNum* restrict d);
789 bc_num_zero(BcNum* restrict n);
796 bc_num_one(BcNum* restrict n);
804 bc_num_cmpZero(const BcNum* n);
824 bc_num_parse(BcNum* restrict n, const char* restrict val, BcBigDig base);
834 bc_num_print(BcNum* restrict n, BcBigDig base, bool newline);
851 bc_num_stream(BcNum* restrict n);
864 bc_num_printDebug(const BcNum* n, const char* name, bool emptyline);
882 bc_num_printWithDigs(const BcNum* n, const char* name, bool emptyline);
885 * Dump debug info about a BcNum variable.
890 bc_num_dump(const char* varname, const BcNum* n);