I made something in excel that calculates the days left until a given date, and from that how many weeks were left. I had it so that 9 days displayed as 1.2 using this formula: $$\frac{\left(\frac{A}{B}-\Bigl\lfloor{\frac{A}{B}}\Bigr\rfloor\right)\cdot B}{10}+\Bigl\lfloor{\frac{A}{B}}\Bigr\rfloor$$
Where $B$ is the "base" you are counting in and $A$ is the number you are trying to count.
This all works and the question is purely for personal interest only.
So, Is there a way to calculate the Integer portion of a fraction only using the operators +, -, $\div$ and *? Thanks In Advance
CEILING
andTRUNCATE
. All three are doing an "integer modulus" operation, which in another programming environment might be accomplished by casting to anint
. Mathematically, these three functions are the main way to get at this information, as there isn't much else that distinguishes one side of the decimal point from the other. $\endgroup$