From edb1d65a93965f47e3052fbbc634df52dd217687 Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Sat, 1 Dec 2018 15:33:53 +1300 Subject: [PATCH] News and compat annotation for #29782 (^(::Number, ::AbstractMatrix)) --- NEWS.md | 1 + base/promotion.jl | 3 +++ 2 files changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index e7a4464b52816..ce4e64332d56a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -82,6 +82,7 @@ Standard library changes * `current_project()` now searches the parent directories of a Git repository for a `Project.toml` file. This also affects the behavior of the `--project` command line option when using the default `--project=@.` ([#29108]). + * Exponentiation operator `^` now supports raising a `Number` to an `AbstractMatrix` power ([#29782]). Compiler/Runtime improvements ----------------------------- diff --git a/base/promotion.jl b/base/promotion.jl index 4eb80c1b68239..351cb2edf69a8 100644 --- a/base/promotion.jl +++ b/base/promotion.jl @@ -341,6 +341,9 @@ julia> A^3 37 54 81 118 ``` + +!!! compat "Julia 1.1" + Julia 1.1. added support for raising a number to a matrix power using `^`. """ ^(x::Number, y::Number) = ^(promote(x,y)...)