PDA

View Full Version : When variable may not fits into WORD limitations



CuriousOne
- 8th July 2013, 13:20
Hello.

I have a situation when a equation like (a*b*c*d)/(a+b+c+d) to be solved. Variables may change from 1 to 100), so result may be well out of allowed range. How to workaround such situation?

pedja089
- 8th July 2013, 13:34
Result=(a*b)/(a+b+c+d)
Result=Result*c*d

CuriousOne
- 16th July 2013, 08:41
And another question. I need to have X divided by 3.6 , since we don't have fractions, I can do X*10/36. But, X*10>65536, so this also does not works. The partial workaround is X*5/18. But still, won't work for large X values. Any ideas how to do conversion?

Acetronics2
- 16th July 2013, 08:51
I have a situation when a equation like (a*b*c*d)/(a+b+c+d) to be solved. Variables may change from 1 to 100)


IF your numbers are <= 100 ... a*b*c*d maximum value is ???

that is outside or inside the compiler limitations ???

just my two cents ... :rolleyes:

Alain

HenrikOlsson
- 16th July 2013, 09:26
I need to have X divided by 3.6
As with most things it depends....on the resolution and accuracy you need and/or can live with it. Try X */ 71 or X ** 18204 or use DIV32 or switch to a LONG (if using 18 series).

/Henrik.