{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Hello world\n" ] } ], "source": [ "greeting = \"Hello world\"\n", "println(greeting)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(0.9800665778412416, 2.302585092994046, 1.22)" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a,b,c = cos(0.2), log(10), abs(-1.22)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.9800665778412416" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "search: \u001b[0m\u001b[1mc\u001b[22m\u001b[0m\u001b[1mo\u001b[22m\u001b[0m\u001b[1ms\u001b[22m \u001b[0m\u001b[1mc\u001b[22m\u001b[0m\u001b[1mo\u001b[22m\u001b[0m\u001b[1ms\u001b[22mh \u001b[0m\u001b[1mc\u001b[22m\u001b[0m\u001b[1mo\u001b[22m\u001b[0m\u001b[1ms\u001b[22md \u001b[0m\u001b[1mc\u001b[22m\u001b[0m\u001b[1mo\u001b[22m\u001b[0m\u001b[1ms\u001b[22mc \u001b[0m\u001b[1mc\u001b[22m\u001b[0m\u001b[1mo\u001b[22m\u001b[0m\u001b[1ms\u001b[22mpi a\u001b[0m\u001b[1mc\u001b[22m\u001b[0m\u001b[1mo\u001b[22m\u001b[0m\u001b[1ms\u001b[22m a\u001b[0m\u001b[1mc\u001b[22m\u001b[0m\u001b[1mo\u001b[22m\u001b[0m\u001b[1ms\u001b[22mh a\u001b[0m\u001b[1mc\u001b[22m\u001b[0m\u001b[1mo\u001b[22m\u001b[0m\u001b[1ms\u001b[22md sin\u001b[0m\u001b[1mc\u001b[22m\u001b[0m\u001b[1mo\u001b[22m\u001b[0m\u001b[1ms\u001b[22m \u001b[0m\u001b[1mc\u001b[22m\u001b[0m\u001b[1mo\u001b[22mn\u001b[0m\u001b[1ms\u001b[22mt \u001b[0m\u001b[1mc\u001b[22ml\u001b[0m\u001b[1mo\u001b[22m\u001b[0m\u001b[1ms\u001b[22me is\u001b[0m\u001b[1mc\u001b[22m\u001b[0m\u001b[1mo\u001b[22mn\u001b[0m\u001b[1ms\u001b[22mt\n", "\n" ] }, { "data": { "text/latex": [ "\\begin{verbatim}\n", "cos(x)\n", "\\end{verbatim}\n", "Compute cosine of \\texttt{x}, where \\texttt{x} is in radians.\n", "\n", "\\rule{\\textwidth}{1pt}\n", "\\begin{verbatim}\n", "cos(A::AbstractMatrix)\n", "\\end{verbatim}\n", "Compute the matrix cosine of a square matrix \\texttt{A}.\n", "\n", "If \\texttt{A} is symmetric or Hermitian, its eigendecomposition (\\href{@ref}{\\texttt{eigen}}) is used to compute the cosine. Otherwise, the cosine is determined by calling \\href{@ref}{\\texttt{exp}}.\n", "\n", "\\section{Examples}\n", "\\begin{verbatim}\n", "julia> cos(fill(1.0, (2,2)))\n", "2×2 Array{Float64,2}:\n", " 0.291927 -0.708073\n", " -0.708073 0.291927\n", "\\end{verbatim}\n" ], "text/markdown": [ "```\n", "cos(x)\n", "```\n", "\n", "Compute cosine of `x`, where `x` is in radians.\n", "\n", "---\n", "\n", "```\n", "cos(A::AbstractMatrix)\n", "```\n", "\n", "Compute the matrix cosine of a square matrix `A`.\n", "\n", "If `A` is symmetric or Hermitian, its eigendecomposition ([`eigen`](@ref)) is used to compute the cosine. Otherwise, the cosine is determined by calling [`exp`](@ref).\n", "\n", "# Examples\n", "\n", "```jldoctest\n", "julia> cos(fill(1.0, (2,2)))\n", "2×2 Array{Float64,2}:\n", " 0.291927 -0.708073\n", " -0.708073 0.291927\n", "```\n" ], "text/plain": [ "\u001b[36m cos(x)\u001b[39m\n", "\n", " Compute cosine of \u001b[36mx\u001b[39m, where \u001b[36mx\u001b[39m is in radians.\n", "\n", " ────────────────────────────────────────────────────────────────────────────\n", "\n", "\u001b[36m cos(A::AbstractMatrix)\u001b[39m\n", "\n", " Compute the matrix cosine of a square matrix \u001b[36mA\u001b[39m.\n", "\n", " If \u001b[36mA\u001b[39m is symmetric or Hermitian, its eigendecomposition (\u001b[36meigen\u001b[39m) is used to\n", " compute the cosine. Otherwise, the cosine is determined by calling \u001b[36mexp\u001b[39m.\n", "\n", "\u001b[1m Examples\u001b[22m\n", "\u001b[1m ≡≡≡≡≡≡≡≡≡≡\u001b[22m\n", "\n", "\u001b[36m julia> cos(fill(1.0, (2,2)))\u001b[39m\n", "\u001b[36m 2×2 Array{Float64,2}:\u001b[39m\n", "\u001b[36m 0.291927 -0.708073\u001b[39m\n", "\u001b[36m -0.708073 0.291927\u001b[39m" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "? cos" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1.0" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cos(0)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-1.0" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cos(π)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "6.123233995736766e-17" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cos(π/2)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Irrational{:π}" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "typeof(π)" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "12 methods for generic function muladd: