This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / special / _basic / euler

function

scipy.special._basic:euler

source: build-install/usr/lib/python3.14/site-packages/scipy/special/_basic.py:2163

Signature

def euler(n)

Summary

Euler numbers E(0), E(1), ..., E(n).

Extended Summary

The Euler numbers [1] are also known as the secant numbers.

Because euler(n) returns floating point values, it does not give exact values for large n. The first inexact value is E(22).

Parameters

n : int

The highest index of the Euler number to be returned.

Returns

: ndarray

The Euler numbers [E(0), E(1), ..., E(n)]. The odd Euler numbers, which are all zero, are included.

Examples

import numpy as np
from scipy.special import euler
euler(6)
✓
array([  1.,   0.,  -1.,   0.,   5.,   0., -61.])
euler(13).astype(np.int64)
✓
array([      1,       0,      -1,       0,       5,       0,     -61,
             0,    1385,       0,  -50521,       0, 2702765,       0])
euler(22)[-1]  # Exact value of E(22) is -69348874393137901.
✗
np.float64(-6.9348874393137976e+16)

Aliases

  • scipy.special.euler