|
LMMP 4.3.0
Lamina High-Precision Arithmetic Library
|
#include <math.h>#include "impl/inlines.h"#include "mparam.h"#include "impl/tmp_alloc.h"#include "lmmp/lmmpn.h"#include "lmmp/numth.h"函数 | |
| static mp_size_t | floor1_u64 (double r) |
| 计算floor(r)+1并转为mp_size_t | |
| mp_size_t | lmmp_pow_ (mp_ptr restrict dst, mp_size_t rn, mp_srcptr restrict base, mp_size_t n, ulong exp) |
| mp_size_t | lmmp_pow_1_size_ (mp_limb_t base, ulong exp) |
| 计算幂次方需要的limb缓冲区长度 base ^ exp | |
| mp_size_t | lmmp_pow_size_ (mp_srcptr base, mp_size_t n, ulong exp) |
| 计算幂次方需要的limb缓冲区长度 [base,n] ^ exp | |
| static double | ulong_upper_d (ulong x) |
| Copyright (C) 2026 HJimmyK (Jericho Knox) | |
|
inlinestatic |
计算floor(r)+1并转为mp_size_t
| r | 位数估计值(非负) |
引用了 floor1_u64() , 以及 MP_SIZE_MAX.
被这些函数引用 floor1_u64(), lmmp_pow_1_size_() , 以及 lmmp_pow_size_().
| mp_size_t lmmp_pow_ | ( | mp_ptr restrict | dst, |
| mp_size_t | rn, | ||
| mp_srcptr restrict | base, | ||
| mp_size_t | n, | ||
| ulong | exp ) |
引用了 lmmp_copy, lmmp_limb_bits_, lmmp_limb_popcnt_, lmmp_mul_1_(), lmmp_param_assert, lmmp_pow_(), lmmp_pow_1_(), lmmp_pow_basecase_(), lmmp_pow_size_(), lmmp_pow_win2_(), lmmp_sqr_, lmmp_tailing_zeros_, lmmp_zero, n, POW_1_EXP_THRESHOLD, POW_WIN2_EXP_THRESHOLD, POW_WIN2_N_THRESHOLD, restrict, TALLOC_TYPE, TEMP_DECL , 以及 TEMP_FREE.
计算幂次方需要的limb缓冲区长度 base ^ exp
| base | 底数 |
| exp | 指数 |
引用了 floor1_u64(), LIMB_BITS, lmmp_limb_bits_, lmmp_param_assert, lmmp_pow_1_size_(), MP_SIZE_MAX , 以及 ulong_upper_d().
被这些函数引用 check_pow1_agree(), check_pow1_laws(), lmmp_nCr_size_(), lmmp_nPr_size_(), lmmp_pow_1_size_(), lmmp_pow_size_(), lmmp_powmod_() , 以及 pow_nPr_().
计算幂次方需要的limb缓冲区长度 [base,n] ^ exp
| base | 底数指针 |
| n | 底数 limb 长度 |
| exp | 指数 |
引用了 floor1_u64(), LIMB_BITS, lmmp_limb_bits_, lmmp_param_assert, lmmp_pow_1_size_(), lmmp_pow_size_(), MP_SIZE_MAX, n, t , 以及 ulong_upper_d().
被这些函数引用 lmmp_pow_(), lmmp_pow_size_(), lmmp_powmod_(), TEST_CASE() , 以及 TEST_CASE().
|
inlinestatic |
Copyright (C) 2026 HJimmyK (Jericho Knox)
This file is part of LMMP.
LMMP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library. If not, see https://www.gnu.org/licenses/.
SPDX-License-Identifier: LGPL-3.0-or-later
将x转换为不小于x的double(提取高53位)
| x | 输入 |
引用了 lmmp_limb_bits_ , 以及 ulong_upper_d().
被这些函数引用 lmmp_pow_1_size_(), lmmp_pow_size_() , 以及 ulong_upper_d().