Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
double_conversion.h
00001 /* AVR-GCC does not have real double datatype. Instead its double 00002 * is equal to float, i.e. 32 bit value. If you need to communicate 00003 * with other systems that use double in their .proto files, you 00004 * need to do some conversion. 00005 * 00006 * These functions use bitwise operations to mangle floats into doubles 00007 * and then store them in uint64_t datatype. 00008 */ 00009 00010 #ifndef DOUBLE_CONVERSION 00011 #define DOUBLE_CONVERSION 00012 00013 #include <stdint.h> 00014 00015 /* Convert native 4-byte float into a 8-byte double. */ 00016 extern uint64_t float_to_double(float value); 00017 00018 /* Convert 8-byte double into native 4-byte float. 00019 * Values are rounded to nearest, 0.5 away from zero. 00020 * Overflowing values are converted to Inf or -Inf. 00021 */ 00022 extern float double_to_float(uint64_t value); 00023 00024 00025 #endif 00026
Generated on Thu Jul 14 2022 02:43:24 by
1.7.2