Hi @IgorR,
@IgorR wrote:
But to perform calculations on the values I need them to be in format of real numbers with all decimals. It's very important because i work with very large numbers and every decimal make sense.
So I need format that will keep the whole data.
Note that a SAS format does not change the value of a variable. So, if the calculations are performed in SAS, you can be sure that all decimals (more precisely: all binary digits of the internal representation) are used, regardless of the format attached or used for display.
Example (log) using one of the values from your initial post:
130 data _null_;
131 p=0.0854571645604569;
132 put (4*p)(best16. / best20.-l / +1 e21. / binary64.);
133 run;
0.08545716456046
0.08545716456045
8.54571645604570E-02
0011111110110101111000001000010101001110111111101111110101001110
As you can see, in this case the E21. format reveals one additional decimal and shows that BEST16., unlike BEST20., rounded the previous decimal correctly. Yet, the "...70" is still rounded, compared to the original numeric literal in the assignment statement. A conversion of the binary digits of the internal binary representation (shown by the BINARY64. format) results in
0.0854571645604569052334653633806738071143627166748046875
confirming that also the last decimal (9) of the original value is present internally. Better still, the conversion of internal binary representations modified in the least significant bit (-/+ 1) shows that the internal accuracy goes slightly beyond that last decimal:
0.08545716456045689135567755556621705181896686553955078125
0.0854571645604569052334653633806738071143627166748046875
0.08545716456045691911125317119513056240975856781005859375
... View more