![]() |
Arduino Core for STM32
1.0
|
Library that contain function, that can convert floating point number to array. More...
#include <type_traits>
#include <math.h>
Go to the source code of this file.
Macros | |
#define | MAX_PRECISION (10) |
Functions | |
template<typename T > | |
std::enable_if< std::is_floating_point< T >::value, char * >::type | ftoa (T f, char *buf, int precision) |
Converts floating point number to char array. More... | |
Library that contain function, that can convert floating point number to array.
stm32tpl – STM32 C++ Template Peripheral Library
Visit https://github.com/antongus/stm32tpl for new versions<br>
Copyright (c) 2011-2020 Anton B. Gusev aka AHTOXA<br>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This library is modified copy for STM32 of stm32tpl ftoa library.
Modified by: Matej Fitoš
#define MAX_PRECISION (10) |
std::enable_if<std::is_floating_point<T>::value, char*>::type ftoa | ( | T | f, |
char * | buf, | ||
int | precision | ||
) |
Converts floating point number to char array.
f | Floating point number |
buf | Char buffer where will be converted floating point number written. |
precision | Number of digits displayed after decimal point. |