double.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _PICO_DOUBLE_H
8 #define _PICO_DOUBLE_H
9 
10 #include <math.h>
11 #include "pico.h"
12 #include "pico/bootrom/sf_table.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
35 double fix2double(int32_t m, int e);
36 double ufix2double(uint32_t m, int e);
37 double fix642double(int64_t m, int e);
38 double ufix642double(uint64_t m, int e);
39 
40 // These methods round towards -Infinity.
41 int32_t double2fix(double f, int e);
42 uint32_t double2ufix(double f, int e);
43 int64_t double2fix64(double f, int e);
44 uint64_t double2ufix64(double f, int e);
45 int32_t double2int(double f);
46 int64_t double2int64(double f);
47 
48 // These methods round towards 0.
49 int32_t double2int_z(double f);
50 int64_t double2int64_z(double f);
51 
52 double exp10(double x);
53 void sincos(double x, double *sinx, double *cosx);
54 double powint(double x, int y);
55 
56 #ifdef __cplusplus
57 }
58 #endif
59 
60 #endif