float.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_FLOAT_H
8 #define _PICO_FLOAT_H
9 
10 #include <math.h>
11 #include <float.h>
12 #include "pico.h"
13 #include "pico/bootrom/sf_table.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
36 float fix2float(int32_t m, int e);
37 float ufix2float(uint32_t m, int e);
38 float fix642float(int64_t m, int e);
39 float ufix642float(uint64_t m, int e);
40 
41 // These methods round towards -Infinity.
42 int32_t float2fix(float f, int e);
43 uint32_t float2ufix(float f, int e);
44 int64_t float2fix64(float f, int e);
45 uint64_t float2ufix64(float f, int e);
46 int32_t float2int(float f);
47 int64_t float2int64(float f);
48 
49 // These methods round towards 0.
50 int32_t float2int_z(float f);
51 int64_t float2int64_z(float f);
52 
53 float exp10f(float x);
54 void sincosf(float x, float *sinx, float *cosx);
55 float powintf(float x, int y);
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif