10 can be represents as 1010 in bits. How can we represent 10.5 in bits.
A data type is called as decimal, same time system of counting based on the number ten also called as decimal. What is the reason for that?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Sep 30, 2013, 7:32 AM
The details are complex but the format is known as IEC 60559 and details of this can be found here:
http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=57469
There are several ways to show what the individual bytes (and hence bits) of a float or double are. I can show you how to do this if you want though I doubt whether you'll find the details very useful.
To understand the 'decimal' type, it's necessary to review some history.
In COM and VB4/5/6 programming, there was an 8 byte data type known as Currency which (IIRC) was accurate to 4 d.p.
This wasn't sufficiently accurate for many purposes and a 16 byte Decimal type was introduced as well (accurate to 28 d.p.) though only as one of the sub-types of the Variant type. The name was probably chosen for lack of a better one!
When .NET came along, it was decided to standardize on the Decimal type (decimal in C#) and the Currency type wasn't therefore brought across as one of the standard types (it should have been IMO but there we are).
Posted Sep 30, 2013, 7:58 AM