# Calc Basic macro integer arithmetic problem

I'm dealing with prime number fractions and have noticed that Calc Basic isn't really using integer. It's rounding if I do a divide for instance rather than truncation. It's using some sort of rounding process. I also then noticed that some integer functions are stated to return double so it looks like pure integer is never used under the hood.

I wonder if there are any compiler options to prevent the rounding or even better force true integer. Mod seems to work ok but as there is no quotient that I am aware of so I have to use divide.

I chose the integer way as the macro has to loop through 4,000 numbers and I can't check all of them. If done in pure integer all numbers have to be ok just on the basis of one being correct. Float has been known to cause problems with what I am doing.

Well I didn't expect an answer but feel the lack of true integer variables is disgusting.

As opposed to the spreadsheet cells where any numerical value is IEEE Double, LibreOffice BASIC

hasinteger types. What you may grumble about is that integer arithmetic isn't supported to the degree you would like. Btw: the operator @hasklo mentioned should be equivalent to Quotient(Numerator, Denominator).Generally machine arithmetic does not support unlimited precision for integer numbers. If you need it, you have to resort to mathematical software. Try the free 'Maxima' e.g.