LMMP 4.3.0
Lamina High-Precision Arithmetic Library
载入中...
搜索中...
未找到
fill.c
浏览该文件的文档.
1/**
2 * Copyright (C) 2026 HJimmyK (Jericho Knox)
3 *
4 * This file is part of LMMP.
5 *
6 * LMMP is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 3 of
9 * the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see
18 * <https://www.gnu.org/licenses/>.
19 *
20 * SPDX-License-Identifier: LGPL-3.0-or-later
21 */
22
23#include "lmmp/lmmp.h"
24
25
26void lmmp_fill(mp_ptr begin, mp_ptr end, mp_limb_t val) {
27 lmmp_param_assert(begin != NULL && end != NULL);
28 for (mp_ptr p = begin; p < end; p++) {
29 *p = val;
30 }
31}
32
34 lmmp_param_assert(dst != NULL);
35 for (mp_size_t i = 0; i < len; i++) {
36 dst[i] = val;
37 }
38}
void lmmp_fill(mp_ptr begin, mp_ptr end, mp_limb_t val)
填充[begin,end)内的数组,值为val
定义 fill.c:26
mp_limb_t * mp_ptr
定义 lmmp.h:96
uint64_t mp_size_t
定义 lmmp.h:93
void lmmp_fill_n(mp_ptr dst, mp_size_t len, mp_limb_t val)
填充从dst开始的长度为len的数组,值为val
定义 fill.c:33
uint64_t mp_limb_t
定义 lmmp.h:92
#define lmmp_param_assert(x)
定义 lmmp.h:509