Function to get quotient from division

in the listed Arithmetic functions, i see MOD, but no equivalent INTEGER (which is the more useful and frequently used)

and strangely i see no mention of Integer in any Posts (in this context)

have i missed something?

I don't exactly understand what you mean. Please give an example for an "equivalent INTER function" to mod and whatfore you need it..

The MP3Tag Help page says:

Arithmetic Functions

Integer arithmetic only

hi there.
how's your maths?
how is the reference to "Integer arithmetic' relevant?

MOD is the 'remainder' after a division (technically not a 'remainder, but near enough for our purposes), ie the RHS after the decimal point

INTEGER is sort of the opposite of MOD - it is the INTEGER part after a division

so the MOD of say 7310/3600 (seconds) is .030555555555556, NOT btw 110 which iS the remainder

and the INTEGER in this case is 2 (hours)

if you then multible the MOD by 60, you end up with a INTEGER of 1 (minute) and a MOD of .833333333333333

which is you multiple by 60 you get 50 seconds as the remainder

ie 2:01:50 duration

How is your reading?
In the documentation

You find 6 functions for arithmatic and the function you are looking for is just above the description of $mod()

Function Description
$div(x,y) divides x by y.
$mod(x,y) returns the remainder of x divided by y.
and as all function deal with integers, the result of a division is also an integer.

Or in short the function is called $DIV() - there is nothing missing.

so $DIV is not Div: it is actually $INT - which would be the standard name

At least in Python INT() transforms a floating point number into an integer.
This works on any floating point number, not necessary only as part of a division.
IMHO INT is not the same as getting the quotient and remainder as $DIV() and $MOD() do.
If you are looking for a function that works like INT(), check out $NUM() in MP3tag.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.