num.h (76238846ad3e9e271a3d1f792f72beab727fd153) num.h (f4fbc49d201f81c481a33fac6ba28e19faf96260)
1/*
2 * *****************************************************************************
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 *
6 * Copyright (c) 2018-2023 Gavin D. Howard and contributors.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 197 unchanged lines hidden (view full) ---

206
207/// The number of allocations done by bc_num_k(). If you change the number of
208/// allocations, you must change this. This is done in order to allocate them
209/// all as one allocation and just give them all pointers to different parts.
210/// Works pretty well, but you have to be careful.
211#define BC_NUM_KARATSUBA_ALLOCS (6)
212
213/**
1/*
2 * *****************************************************************************
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 *
6 * Copyright (c) 2018-2023 Gavin D. Howard and contributors.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 197 unchanged lines hidden (view full) ---

206
207/// The number of allocations done by bc_num_k(). If you change the number of
208/// allocations, you must change this. This is done in order to allocate them
209/// all as one allocation and just give them all pointers to different parts.
210/// Works pretty well, but you have to be careful.
211#define BC_NUM_KARATSUBA_ALLOCS (6)
212
213/**
214 * Rounds @a s (scale) up to the next power of BC_BASE_DIGS. This also check for
215 * overflow and gives a fatal error if that happens because we just can't go
216 * over the limits we have imposed.
214 * Rounds @a s (scale) up to the next power of BC_BASE_DIGS. This will also
215 * check for overflow and gives a fatal error if that happens because we just
216 * can't go over the limits we have imposed.
217 * @param s The scale to round up.
218 * @return @a s rounded up to the next power of BC_BASE_DIGS.
219 */
220#define BC_NUM_ROUND_POW(s) (bc_vm_growSize((s), BC_BASE_DIGS - 1))
221
222/**
223 * Returns the equivalent rdx for the scale @a s.
224 * @param s The scale to convert.

--- 689 unchanged lines hidden ---
217 * @param s The scale to round up.
218 * @return @a s rounded up to the next power of BC_BASE_DIGS.
219 */
220#define BC_NUM_ROUND_POW(s) (bc_vm_growSize((s), BC_BASE_DIGS - 1))
221
222/**
223 * Returns the equivalent rdx for the scale @a s.
224 * @param s The scale to convert.

--- 689 unchanged lines hidden ---