Skip to main content

Posts

FLOATING POINT NUMBERS

FLOATING POINT NUMBERS AND REPRESENTATION- A new recipie which is completely based on floating point numbers or float data type according to IEEE standard . This blog contains complete hidden and complex details of float data type like how they represent,what happen when int convert into floats etc.. SO LET'S START- Generally, no matter either you are from programming background or not . I think students hear the "float" terms many times. float is just a common representation of number in decimal form ex-12.34. Today they are  the common way to represent the real numbers on computers. WHY WE REQUIRE FLOATING POINT NUMBERS- Basically, we can easily represent any integer using int data type like 45, but if we want to represent the 1000th part of 45, then how we can represent it with accuracy and precision. and mainly they are use in computers widely, to represent the real numbers. due to that float concept come which is introduced by IEEE 754 and the new data ty...
Recent posts

CONSTANTS AWAKENING

CONSTANTS AWAKENING- This heading looks like very cool recipie .yes i will guarranteed you that this blog present only small topic which you know very well but something you didn't know really interesting and important in terms of quality of code. SO LET'S START-- You know very well that what is constant. constants are those values which are fixed and can't change their values during whole program.There are many types of constants present in programming like integer constant, string constant, enumeration constants etc. An integer constant generally look simply like 1234. A long constant is written with terminal 1(ell) or L ex-1234567L. Unsigned int are written with terminal u and unsigned long with terminal ul. ex--25u & 2345ul. Similarly, floating point constants written with terminal f or F ex--2.5f and long double constants with terminal  L.  The value of an integer can be specified in octal or hexadecimal generally, instead of decimal. A leading 0(ze...

HOW INT'S PERFORM AT BIT LEVEL

HOW INT'S PERFORM AT BIT LEVEL-- As we discussed in the last blog about the int.But many users request to go more deep to give explanation about how int's actually perform at bit level. SO LET'S START - As we discussed in last blog about range of int's that using arithmetic modulo 2^n where n is the no. of bits we can find the range it is correct But in computation mainly 2^n-1 uses to find the range of int data types.see how--Let's take example of char which is also a one form of the int.char have 8 bits and using 2^8 we get 256 characters.but its range is 0 to 255 due to includation of 0 means 2^8-1.that's why we use 2^n-1 because it is correct in terms of representation.  BUT HOW IT LOOK AT BIT LEVEL-- As we know that char takes 1 byte  means 8 bits and at memory level we know that only binary system uses means 0 or 1 and each bit is filled with either 0 or 1.so there are many combinations let's see the char representation -Here i use '#' to...

THINK INT#A complete advanced description about int data type#

A Complete Advanced Description About int                                  Datatype Int's are those datatypes which are used represent the real numbers either positive or negative with a specific range.mainly int divides into 2 types signed or unsigned int. signed int are same as plain int. they can defined through 3 ways 1.int_            2.signed_           3.signed int_ signed int can be positive,negative or 0.It has minimum range of atleast -32767 to 32767. while unsigned int are the int who always have positive value and their range is 0 to 65535.            Representation of integers in memory since int are always performed modulo 2^n where n is no. of bits in that particular int.the total range of numbers that can represent a number.2^16 is the same as 65536,which since count from 0,is the same as 0...