Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
anu2
Warnings : 1

New User

Joined: 10 Jun 2007
Posts: 36
Location: Chennai

 Posted: Fri Aug 24, 2007 3:25 pm    Post subject: Difference between Floating Point & Decimal Point Hi , Please let me know the difference between Floating Point & Decimal Point. Regards, anu

dbzTHEdinosauer

Global Moderator

Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

 Posted: Fri Aug 24, 2007 3:37 pm    Post subject: floating point is a numeric datatype. decimal point is a notation to separate the integer portion of a number and the fractional portion of a number
anu2
Warnings : 1

New User

Joined: 10 Jun 2007
Posts: 36
Location: Chennai

 Posted: Fri Aug 24, 2007 5:12 pm    Post subject: Reply to: Difference between Floating Point & Decimal Po In that case then what would be the difference between Floating Point and an integer. Please let me know.
William Thompson

Global Moderator

Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

Posted: Fri Aug 24, 2007 5:19 pm    Post subject:

 dbzTHEdinosauer wrote: floating point is a numeric datatype. decimal point is a notation to separate the integer portion of a number and the fractional portion of a number
That's mean...

Anu, start by reading the section on Computational items in the Language Reference.
dbzTHEdinosauer

Global Moderator

Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

 Posted: Fri Aug 24, 2007 5:44 pm    Post subject: No, it was not meant to be mean. He asked what is the difference between an apple and a stove. both have to do with eating, but..... floating point datatype (can be short, long and real long) stores the number as scientific notation. (you can google scientific notation). Floating Point is a container. a decimal point is a attribute for numeric datatype containers. e.g., integers do not have a decimal point attribute. A non-computer example is when speaking of dollars and cents; the decimal point separates the two. A decimal point, unique to base 10 arithmetic, separates the integer portion (whole numbers) and the number and the > 1 & > 0 portion (fractional numbers) of the quantity.
dbzTHEdinosauer

Global Moderator

Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

 Posted: Fri Aug 24, 2007 6:54 pm    Post subject: William, Mean would have been: Decimal Points are fixed; floating points aren't.
William Thompson

Global Moderator

Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

Posted: Fri Aug 24, 2007 7:14 pm    Post subject:

 dbzTHEdinosauer wrote: Mean would have been: Decimal Points are fixed; floating points aren't.
better....
vasanthkumarhb

Active User

Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

 Posted: Fri Sep 28, 2007 2:52 pm    Post subject: Hi......... It is the basic thing, u must studied in your graduation......let it be.... Floating point: the varaible which is declared as a floating point variable, then varaible is can allows integer numbers from 0 to 9 with all possible combination with decimal point. in other words can be called as Real number Integer: the variable declared with integer will allows combination numerals from 0 t0 9 with all possible combination with out a decimal point Floating point and decimal point both are same there is no distinctiion between them....... Thanks Vasanth.........
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

Posted: Fri Sep 28, 2007 9:26 pm    Post subject:

Hello Vasanth,

 Quote: Floating point and decimal point both are same there is no distinctiion between them.......
You might want to do a bit of research and then post back here why this is in error. . . .

Floating point arithmetic and decimal arithmetic are not the same.
vasanthkumarhb

Active User

Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

 Posted: Mon Oct 01, 2007 3:02 pm    Post subject: Hi all Hi Dick, Me trying to explain here, if u find incorrect pls correct me. * If the variable is represented in decimal point form, then varaible will be declared with integer part and the expected decimal point and the number of points after the decimal point also decided and if you use this variable for manipulation and for displaying the answer in the output window. The structure of the declaration is retained in the ouput answer too, means the integer part as in declaration and the decimal point and the number of digits after the decimal point is retained.. *If the variable is declared with floating point, then, here also there will be expected decimal point but here the number of digits after the decimal point will float, means if u use this variable for manipulation and for displaying the answer, it will give you complete precission of the answer after the decimal point at the output window... Regard's Vasanth........
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

Posted: Tue Oct 02, 2007 5:40 am    Post subject:

Hi Vansanth,

Please check out the following and see if if helps clear things up.

Quote:
At the heart of many strange results is one fundamental: floating-point on computers is usually base 2, whereas the external representation is base 10. We expect that 1/3 will not be exactly representable, but it seems intuitive that .01 would be. Not so! .01 in IEEE single-precision format is exactly 10737418/1073741824 or approximately 0.009999999776482582. You might not even notice this difference until you see a bit of code like the following:
 Code: REAL X DATA X /.01/ IF ( X * 100.d0 .NE. 1.0 ) THEN    PRINT *, 'Many systems print this surprising result. ' ELSE    PRINT *, 'And some may print this.' ENDIF

Floating-point arithmetic on digital computers is inherently inexact. The 24 bits (including the hidden bit) of mantissa in a 32-bit floating-point number represent approximately 7 significant decimal digits. Unlike the real number system, which is continuous, a floating-point system has gaps between each number. If a number is not exactly representable, then it must be approximated by one of the nearest representable values.
Because the same number of bits are used to represent all normalized numbers, the smaller the exponent, the greater the density of representable numbers. For example, there are approximately 8,388,607 single-precision numbers between 1.0 and 2.0, while there are only about 8191 between 1023.0 and 1024.0.

On any computer, mathematically equivalent expressions can produce different values using floating-point arithmetic. In the following example, Z and Z1 will typically have different values because (1/Y) or 1/7 is not exactly representable in binary floating-point:

If you'd like a lot more explanation/examples of how floating point arithmetic differs from decimal arithmetic, check out
http://www.lahey.com/float.htm
vasanthkumarhb

Active User

Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

 Posted: Mon Oct 08, 2007 5:24 pm    Post subject: Hi Dick, I posted the same, wat is explained above by you, but helps me a lot. Thank you for your valuable reply. Regard's vasanth.....
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

 Posted: Tue Oct 09, 2007 6:27 am    Post subject: You're welcome Your intent may have been the same, but your post does not say the exactly the same thing (in English). That is a situation we have to consider often in these forums.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics How to group and sum the decimal value sakrat DFSORT/ICETOOL 2 Tue Mar 06, 2018 9:13 pm ISMF Difference between volume count ... upendrasri IBM Tools 2 Tue Dec 05, 2017 12:40 pm Finding difference between two PS fil... Vignesh Sid SYNCSORT 5 Mon Oct 30, 2017 1:13 pm Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us