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