binary numbers, binary system, digital-6611658.jpg

How do floating-point numbers represent in memory?

Background: Say you have this C program which fakes a sin waveform output by calculating a floating-point number and then convert it to an integer: void main() { unsigned int value; float signal; signal=2047.0*(1+sin(2*3.142*count/50.0)); value=signal; } We first calculate “signal” which is a floating-point number. Then, we assign “value” to “signal”! note that “value” is

How do floating-point numbers represent in memory? Read More »