public function cos($scale = null)
{
// First normalise the number in the [0, 2PI] domain
$x = $this->mod(DecimalConstants::PI()->mul(Decimal::fromString("2")));
// PI has only 32 significant numbers
$scale = $scale === null ? 32 : $scale;
return self::factorialSerie($x, DecimalConstants::one(), function ($i) {
return $i % 2 === 0 ? $i % 4 === 0 ? DecimalConstants::one() : DecimalConstants::negativeOne() : DecimalConstants::zero();
}, $scale);
}