The program simply starts with the number nine (9), and repeatedly divides it by ten (10), and should display the following result:
0.9 0.9
0.09 0.089999996
0.009 0.0090
0.0009 9.0E-4
0.00009 9.0E-5
0.000009 9.0E-6
9E-7 9.0000003E-7
9E-8 9.0E-8
9E-9 9.0E-9
9E-10 8.9999996E-10
where the left-hand column is the results given using the new BigDecimal
class, and the right-hand column is the results obtained using the
binary float datatype.
You can use the program for testing your installation of the decimal package; the program is available in both Java and NetRexx:
Java
|
NetRexx
|