Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mixing variable types in a numerical calculation
Thanks for the explanation. That is pretty counter-intuitive and a bit horrible to debug when the results aren't as expected.

It's a very un-BASIC-like programming discipline, to have to break down every single mathematical expression and consider whether each variable will max out within the scope of the calculation. I'll probably just DIM more variables as UINTEGER to avoid this kind of problem, so my program's performance and memory footprint will likely end up worse than if the compiler offered coercion. I did spot some truncation issue in edge cases elsewhere in my code for similar reasons.

For the example given though I will use that suggested library, which I had also spotted after I posted this topic.
I keep thinking about that Ariane rocket that blew up because of a casting error Smile

Messages In This Thread
RE: Mixing variable types in a numerical calculation - by patters - 01-05-2021, 01:15 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)