avr-gcc float

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From Polish to

Threaded View
Witam.
Szukam i nie mogę znaleźć.
Jaka może być maksymalna wartość zmiennej typu float i ile ona zajmuje 4
bajty?

Pozdrawiam
Paweł




Re: avr-gcc float
Quoted text here. Click to load it

Float zajmuje 4 bajty, a tu masz liste zmniennych:

(signed/unsigned) char - 1 byte
(signed/unsigned) short - 2 bytes
(signed/unsigned) int - 2 bytes
(signed/unsigned) long - 4 bytes
(signed/unsigned) long long - 8 bytes
float - 4 bytes (floating point)
double - alias to float


Re: avr-gcc float
pawel pisze:
Quoted text here. Click to load it

http://en.wikipedia.org/wiki/Single_precision_floating-point_format

The minimum positive (subnormal) value is 2^−149 ≈ 1.4 × 10^−45. The
minimum positive normal value is 2^−126 ≈ 1.18 × 10^−38. The maximum
representable value is (2−2^−23) × 2^127 ≈ 3.4 × 10^38.

Site Timeline