1
0
mirror of https://github.com/kalmarek/GroupRings.jl.git synced 2024-07-30 06:05:31 +02:00
This commit is contained in:
kalmar 2017-05-17 11:36:47 +02:00
parent 085c47ddd3
commit 679166114e

View File

@ -178,9 +178,9 @@ end
function scalar_multiplication{T<:Number, S<:Number}(a::T,
X::GroupRingElem{S})
promote_type(T,S) == S || warn("Scalar and coeffs are in different rings! Promoting result to $(promote_type(T,S))")
promote_type(T,S) == S || warn("Scalar and coeffs are in different rings!
Promoting result to $(promote_type(T,S))")
return GroupRingElem(a*X.coeffs, parent(X))
end
end
(*){T<:Number}(a::T,X::GroupRingElem) = scalar_multiplication(a, X)
@ -188,10 +188,9 @@ end
(/){T<:Number}(a::T, X::GroupRingElem) = scalar_multiplication(1/a, X)
(//){T<:Rational, S<:Rational}(X::GroupRingElem{T}, a::S) =
GroupRingElem(X.coeffs//a, parent(X))
GroupRingElem(X.coeffs//a, parent(X))
(//){T<:Rational, S<:Integer}(X::GroupRingElem{T}, a::S) =
X//convert(T,a)
(//){T<:Rational, S<:Integer}(X::GroupRingElem{T}, a::S) = X//convert(T,a)
###############################################################################
#