Top "Floating-point-conversion" questions

Anything related to converting a floating point number to and from other representations.

Converting float to char*

How can I convert a float value to char* in C language?

c floating-point floating-point-conversion
square of a float number in C

I have written a code in C which works fine for int but when I try to do this with …

c floating-point floating-point-conversion
How to convert a float into hex

In Python I need to convert a bunch of floats into hexadecimal. It needs to be zero padded (for instance, 0…

python python-2.7 floating-point-conversion
Limit floating point precision?

Is there a way to round floating points to 2 points? E.g.: 3576.7675745342556 becomes 3576.76.

c++ c algorithm floating-point floating-point-conversion
Size of int and float

I have a question about the ranges of ints and floats: If they both have the same size of 4 bytes, …

c floating-point integer floating-point-conversion
printf format float with padding

The following test code produces an undesired output, even though I used a width parameter: int main(int , char* []) { float …

c floating-point floating-point-conversion
Random float number

I wrote this function to get a pseudo random float between 0 .. 1 inclusive: float randomFloat() { float r = (float)rand()/(float)RAND_…

c random floating-point floating-point-conversion
python convert a list of float to string

I have a list of floats in Python and when I convert it into a string, I get the follwoing [1883.95, 1878.3299999999999, 1869.4300000000001, 1863.4000000000001] …

python list formatting floating-point-precision floating-point-conversion
Convert scientific notation to decimal - python

How do I convert a scientific notation to floating point number? Here is an example of what I want to …

python scientific-notation floating-point-conversion
Convert a float to 4 uint8_t

I have got a float variable that I need to send through a CAN protocol. To do so, this float …

c++ casting type-conversion floating-point-conversion uint8t