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

It's difficult to break down every single mathematical expression and consider whether each variable will max out. 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.

As already said before, type coercion is on the TODO's queue. Sorry, but I've had no time to implement it.
Currently coercion is done only on assignation (LET).
Reply


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

Forum Jump:


Users browsing this thread: 2 Guest(s)