Menu Toggle
v2.0.0
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
42
float
int2float(int32_t f);
43
float
uint2float(uint32_t f);
44
float
int642float(int64_t f);
45
float
uint642float(uint64_t f);
46
float
fix2float(int32_t m,
int
e);
47
float
ufix2float(uint32_t m,
int
e);
48
float
fix642float(int64_t m,
int
e);
49
float
ufix642float(uint64_t m,
int
e);
50
51
// These methods round towards -Infinity.
52
int32_t float2fix(
float
f,
int
e);
53
uint32_t float2ufix(
float
f,
int
e);
54
int64_t float2fix64(
float
f,
int
e);
55
uint64_t float2ufix64(
float
f,
int
e);
56
int32_t float2int(
float
f);
57
uint32_t float2uint(
float
f);
58
int64_t float2int64(
float
f);
59
uint64_t float2uint64(
float
f);
60
61
// These methods round towards 0.
62
int32_t float2int_z(
float
f);
63
int64_t float2int64_z(
float
f);
64
int32_t float2uint_z(
float
f);
65
int64_t float2uint64_z(
float
f);
66
67
float
exp10f(
float
x);
68
void
sincosf(
float
x,
float
*sinx,
float
*cosx);
69
float
powintf(
float
x,
int
y);
70
71
#if !PICO_RP2040 || PICO_COMBINED_DOCS
72
int64_t float2fix64_z(
float
f,
int
e);
73
float
fdiv_fast(
float
n,
float
d);
74
float
fsqrt_fast(
float
f);
75
#endif
76
77
#ifdef __cplusplus
78
}
79
#endif
80
81
#endif
float.h
pico.h