binary - Matlab representation of floating point numbers -


matlab results realmax('single') ans = 3.4028e+38. trying understand why number appears computer's binary representation, little bit confused.

i understand realmax('single') highest floating point number represented in single percision 32-bits. means binary representation consists of 1 bit sign, 23 bits mantissa , 8 bit exponent. , 3.4028e+38 decimal representation of highest single precision floating point number, don't know how number derived.

now, typing in 2^128 gives me same answer 3.4028e+38, don't understand correlation.

can me understand why 3.4028e+38 largest returned result floating point number in 32 bit format, coming binary representation perspective? thank you.

as ieee754 specifies, largest magnitude exponent emax=12710=7f16=0111 11112. encoded 25410=fe16=1111 11102 in 8 exponent bits. exponent 25510=ff16=1111 11112 reserved representing infinity, 25410 largest available. exponent bias 12710 subtracted exponent bits leading 25410-12710=12710. largest mantissa attained when 23 mantissa bits set 1. largest value can represented 1.111111111111111111111112x2127=3.402823510x1038.

this site lets set bits of representation , see ieee754 value represented in decimal, binary, , hexadecimal.

also note largest value less 2^128. can see more precise representation of numbers output in matlab using format long. reason similar because 1.111111111111111111111112x2127 close 102x2127=12x2128.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -