Select one of the symbols to view example projects that use it.
 
Outline
#define _PICO_DOUBLE_H
#include <math.h>
#include "pico.h"
#include "pico/bootrom/sf_table.h"
int2double(int32_t);
uint2double(uint32_t);
int642double(int64_t);
uint642double(uint64_t);
fix2double(int32_t, int);
ufix2double(uint32_t, int);
fix642double(int64_t, int);
ufix642double(uint64_t, int);
double2fix(double, int);
double2ufix(double, int);
double2fix64(double, int);
double2ufix64(double, int);
double2int(double);
double2uint(double);
double2int64(double);
double2uint64(double);
double2int_z(double);
double2int64_z(double);
exp10(double);
sincos(double, double *, double *);
powint(double, int);
ddiv_fast(double, double);
sqrt_fast(double);
mla(double, double, double);
Files
loading...
SourceVuRaspberry Pi Pico SDK and ExamplesPicoSDKsrc/rp2_common/pico_double/include/pico/double.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. * * SPDX-License-Identifier: BSD-3-Clause *//* ... */ #ifndef _PICO_DOUBLE_H #define _PICO_DOUBLE_H #include <math.h> #include "pico.h" #include "pico/bootrom/sf_table.h" #ifdef __cplusplus extern "C" { #endif /** \file double.h * \defgroup pico_double pico_double * * \brief Optimized double-precision floating point functions * * (Replacement) optimized implementations are provided of the following compiler built-ins * and math library functions: * * - __aeabi_dadd, __aeabi_ddiv, __aeabi_dmul, __aeabi_drsub, __aeabi_dsub, __aeabi_cdcmpeq, __aeabi_cdrcmple, __aeabi_cdcmple, __aeabi_dcmpeq, __aeabi_dcmplt, __aeabi_dcmple, __aeabi_dcmpge, __aeabi_dcmpgt, __aeabi_dcmpun, __aeabi_i2d, __aeabi_l2d, __aeabi_ui2d, __aeabi_ul2d, __aeabi_d2iz, __aeabi_d2lz, __aeabi_d2uiz, __aeabi_d2ulz, __aeabi_d2f * - sqrt, cos, sin, tan, atan2, exp, log, ldexp, copysign, trunc, floor, ceil, round, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, exp2, log2, exp10, log10, pow,, hypot, cbrt, fmod, drem, remainder, remquo, expm1, log1p, fma * - powint, sincos (GNU extensions) * * The following additional optimized functions are also provided: * * - int2double, uint2double, int642double, uint642double, fix2double, ufix2double, fix642double, ufix642double * - double2fix, double2ufix, double2fix64, double2ufix64, double2int, double2uint, double2int64, double2uint64, double2int_z, double2int64_z, * - exp10, sincos, powint * * On RP2350 the following additional functions are available; the _fast methods are faster but do not round correctly" * * - ddiv_fast, sqrt_fast *//* ... */ double int2double(int32_t i); double uint2double(uint32_t u); double int642double(int64_t i); double uint642double(uint64_t u); double fix2double(int32_t m, int e); double ufix2double(uint32_t m, int e); double fix642double(int64_t m, int e); double ufix642double(uint64_t m, int e); // These methods round towards -Infinity. int32_t double2fix(double d, int e); uint32_t double2ufix(double d, int e); int64_t double2fix64(double d, int e); uint64_t double2ufix64(double d, int e); int32_t double2int(double d); uint32_t double2uint(double d); int64_t double2int64(double d); uint64_t double2uint64(double d); // These methods round towards 0. int32_t double2int_z(double d); int64_t double2int64_z(double d); double exp10(double x); void sincos(double x, double *sinx, double *cosx); double powint(double x, int y); #if !PICO_RP2040 double ddiv_fast(double n, double d); double sqrt_fast(double d); double mla(double x, double y, double z); // note this is not fused/* ... */ #endif #ifdef __cplusplus }extern "C" { ... } #endif /* ... */ #endif
Details