Oh I really do wish computers could add, and multiply, and …
float H = 1.00794; float S = 32.065; float H2S = (2*H + S);
If you believe:
If you appreciate that when 1f, 1.0f and 1.1f are assigned to different variables, and then displayed, the values displayed should be 1, 1.0 and 1.1, and not 1, 1, and 1.1, then you likely understand the issue. I am not aware of any programming languages that support Significant Figures within a native datatype. A programming language that natively supported Significant Figures per arithmetic operation and variable would make my life a lot easier. I don’t think these programming languages exist.
float X = 1.00794f; X = 6.1f;
And yes I do appreciate that the metadata payload to accommodate for the change in significant figures in the variable reassignment of X above would have to be supported by the datatype. This is what I want.
And yes I also appreciate that the multiplicand below (this is in-part the same code excerpt copied from above)
float H2S = (2*H + S);
has just one significant figure too. This is clearly a problem in the arithmetic. Actually the whole thing is a damn problem, and if you don’t see this as a problem, there’s another problem.
— Published by Mike, 14:43:58 16 September 2016
By Month: November 2022, October 2022, August 2022, February 2021, January 2021, December 2020, November 2020, March 2019, September 2018, June 2018, May 2018, April 2018
Apple, C#, Databases, Faircom, General IT Rant, German, Informatics, LINQ, MongoDB, Oracle, Perl, PostgreSQL, SQL, SQL Server, Unit Testing, XML/XSLT
Leave a Reply