Open CommanderTvis opened 4 years ago
I'm not sure how faithful kmath about algebra abstractions. But rings don't have division. You'll get field if you want to add division.
Also while it's possible to define Field for word32/word64. Its division is completely different from usual rounded down division.
Those operations are not a part of Ring
definition. We can add them if it is possible to implement them relying only on basic arithmetic operations. Otherwise, they could be added to short and int rings directly (but it does not make a lot of sense since ints and shorts already have them).
Those operations are not a part of
Ring
definition. We can add them if it is possible to implement them relying only on basic arithmetic operations. Otherwise, they could be added to short and int rings directly (but it does not make a lot of sense since ints and shorts already have them).
It does. For example, for adv-expr
Expressions API: binaryOperation("mod", a, b)
. Without algebra-supported operations, mod and div are simply unaccessible.
@Shimuuar Ring does not have division. It has only multiplication.
@Shimuuar Ring does not have division. It has only multiplication.
I suggest introducing new interface, something like:
interface DivisionWithRemainder<T> : RingOperations<T> {
fun mod(T, T): T
fun div(T, T): T
}
There are no
div
andmod
operations in integer typed rings. They have some use cases in basic arithmetics, so I think, integer algebra is inconsistent without them.