Difference between a REAL and INTEGER Numbers When Rounding

Поділитися
Вставка
  • Опубліковано 6 січ 2025

КОМЕНТАРІ • 9

  • @alnaseri3622
    @alnaseri3622 3 роки тому +1

    Great topic and explanation. Thanks!!

  • @MToytube
    @MToytube 3 роки тому +3

    I keep the same signal generator in my tool bag.. it is super good for the price.

  • @damjandjordjevic1994
    @damjandjordjevic1994 3 роки тому +1

    What's the use of DINT then? Seems like REAL is the way to go....

    • @TimWilborne
      @TimWilborne  3 роки тому +3

      Excellent question, a REAL number loses accuracy the higher it counts A DINT can store whole numbers up to 2,147,483,647. Above 16,777,216, accuracy is lost. Here is a simple exercise. Create a REAL number and enter 16,777,216, then try to enter 16,777,217.

    • @rcarter012
      @rcarter012 3 роки тому +1

      Saves memory, likely increases speed

    • @TimWilborne
      @TimWilborne  3 роки тому +1

      Both a DINT and a REAL are 32 but numbers, they take up the exact same about of memory.

    • @damjandjordjevic1994
      @damjandjordjevic1994 3 роки тому

      @@rcarter012 I suppose it is only quicker in the case where all the numbers in the equation are DINTs. But in that case you get the weird rounding issue presented in this video...