Increase accuracy of 5-byte float to string conversion
Detail: This change rewrites the BASIC105 version of the FCONA routine so that it converts the value to FPA packed decimal format, with ~16 decimal digits of accuracy. To avoid adding an FPA dependency to BASIC105 this is done via a new, custom routine. Apart from improving the accuracy of the result, converting to packed decimal allows the rest of the function body to be shared with the BASIC64 variant of the routine. File changes: s/fp2 - Updated as above. New FACCtoBCD function added to perform the BCD/packed decimal conversion. MAXDIGS for BASIC105 increased to 11+2. Minor FRDFPEXPBIN optimisation. Admin: Tested on BB-xM Although the new FCONA implementation is known not to be fully accurate, testing with Test.Math.Decimal shows a marked improvement over the previous implementation, with ~100m random float -> string -> float conversions being performed without any loss of accuracy Version 1.65. Tagged as 'BASIC-1_65'
Showing
Please register or sign in to comment