View Single Post
Old 27 December 2022, 08:03   #24
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by Bruce Abbott View Post
Ideally I want a decimal fp number that compiles to the same binary value as it was converted from. Unfortunately this relies not only on converting it to decimal 'correctly', but also on the compiler or assembler doing the 'correct' conversion the other way, which in my case (ProAsm) it doesn't (you can input several slightly but significantly different 80 bit fp numbers and they come out the same).
Inputting floats is as complicated as outputting them, if not more.
Hopefully i don't currently need to do that.


Quote:
Originally Posted by Bruce Abbott View Post
This problem is 'solved' by using hex fp literals. However for most purposes I am happy enough getting back what was typed into the original source code, eg. 1000.0 disassembles as 1.0E3, not 9.9999986E2. That's why I round. It's more likely that the original number was 1000 than 999.999??.
Small enough integers should be represented exact, but i see what you mean. Sure if i have $3fff999999999999999a i'll interpret as 1.20 rather than 1.200000047
But i prefer to not round it automatically so i know in which way original number was 'wrong'.
meynaf is offline  
 
Page generated in 0.04472 seconds with 11 queries