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
15extern "C" {
16#endif
17
41double int2double(int32_t i);
42double uint2double(uint32_t u);
43double int642double(int64_t i);
44double uint642double(uint64_t u);
45double fix2double(int32_t m, int e);
46double ufix2double(uint32_t m, int e);
47double fix642double(int64_t m, int e);
48double ufix642double(uint64_t m, int e);
49
50// These methods round towards -Infinity.
51int32_t double2fix(double d, int e);
52uint32_t double2ufix(double d, int e);
53int64_t double2fix64(double d, int e);
54uint64_t double2ufix64(double d, int e);
55int32_t double2int(double d);
56uint32_t double2uint(double d);
57int64_t double2int64(double d);
58uint64_t double2uint64(double d);
59
60// These methods round towards 0.
61int32_t double2int_z(double d);
62int64_t double2int64_z(double d);
63
64double exp10(double x);
65void sincos(double x, double *sinx, double *cosx);
66double powint(double x, int y);
67
68#if !PICO_RP2040
69double ddiv_fast(double n, double d);
70double sqrt_fast(double d);
71double mla(double x, double y, double z); // note this is not fused
72#endif
73
74#ifdef __cplusplus
75}
76#endif
77
78#endif
79