Forum - MCS Electronics

 Problem with Single variable Goto page Previous  1, 2
Author Message

Joined: 30 Dec 2019
Posts: 123

 Posted: Sat Apr 24, 2021 9:50 am    Post subject: Well, I didn't want to anymore, but now I'm going to answer. It's not that simple (which is also in life). The basic definition was given by IEEE 754-1985(https://standards.ieee.org/standard/754-2019.html) standard extended in 2008 and last I guess 2019. If we look at the first extension in 2008 it defined the numbers this way(I will allow the tables to remain in my language) Figure1. Which represents the range fig2. Ways to store floating point numbers Computer systems take advantage of the fact that a selected subset of real numbers can be expressed as XFP = (-1)S × bexponent-bias × m Different computer systems use different bases, and different representations of the mantissa and exponent Fig3 The creator of the system that probably most of us use for the basic one says this https://docs.microsoft.com/en-us/office/troubleshoot/access/floating-calculations-info and admits to not following the standard https://docs.microsoft.com/en-us/office/troubleshoot/excel/floating-point-arithmetic-inaccurate-result Anyone who uses C or C++ for programming knows that they have to decide what they want at the beginning of their own program. Turning translation optimization on to the expected result can mess with your head pretty good. It's even more interesting with interpreted languages. For example, Python 2 behaves quite differently than Python3 when rounding. It's just a fringe thing, and he knows I'm way off topic. Those of us who do this for a living already know this(and that it costs a lot of nerves) and the rest of us have to put up with it. It is interesting that even the manufacturers of the various PLCs each take a different approach to the problem and prefer not to point it out. Such a PID control setup is often nerve wracking. RS
enniom

Joined: 20 Oct 2009
Posts: 496

 Posted: Sat Apr 24, 2021 3:30 pm    Post subject: Somehow NASA sent Apollo 11 to the moon and back using 16 bit, 2MHz, and 2K RAM. It appears the user is more important than bits? E

Joined: 30 Dec 2019
Posts: 123

 Posted: Sun Apr 25, 2021 7:50 am    Post subject: Hi Well, mistakes have been made here too. One that interprets the problem discussed here is written in Ada. L_M_BV_32 := TBD.T_ENTIER_32S ((1.0/C_M_LSB_BV) * G_M_INFO_DERIVE(T_ALG.E_BV)); if L_M_BV_32 > 32767 then P_M_DERIVE(T_ALG.E_BV) := 16#7FFF#; elsif L_M_BV_32 < -32768 then P_M_DERIVE(T_ALG.E_BV) := 16#8000#; else P_M_DERIVE(T_ALG.E_BV) := UC_16S_EN_16NS(TDB.T_ENTIER_16S(L_M_BV_32)); end if; P_M_DERIVE(T_ALG.E_BH) := UC_16S_EN_16NS (TDB.T_ENTIER_16S ((1.0/C_M_LSB_BH) * G_M_INFO_DERIVE(T_ALG.E_BH))); RS
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT + 1 HourGoto page Previous  1, 2 Page 2 of 2

 Jump to: Select a forum BASCOM AVR/8051----------------BASCOM-AVRBASCOM-8051BASCOM-ARDUINOShare your working BASCOM-8051 code hereShare your working BASCOM-AVR code hereBASCOM BETA-SLA BASCOM Related----------------EASY TCP/IPAVR-DOSAR7212KokkeKat FAT-free SD card libBASCOM Project Blog Other Stuff----------------VariousPCB'sRoboticsNew WebSiteAnnouncementsAVR Archive----------------BASCOM-AVR ArchiveBASCOM-8051 ArchiveBASCOM-AVR Unsupported versionsEasy TCP/IP ArchiveBASCOM-EDB
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum