symtegration-0.4.0: Library for symbolic integration of mathematical expressions.
CopyrightCopyright 2025 Yoo Chung
LicenseApache-2.0
Maintainerdev@chungyc.org
Safe HaskellNone
LanguageGHC2021

Symtegration.Numeric

Description

This module contains numerical algorithms that are useful to more than one module, ultimately for the purpose of symbolic integration of mathematical expressions. By numerical algorithms here, we means algorithm that work on pure numbers and not symbols. The algorithms should still return exact results.

Synopsis

Documentation

root Source #

Arguments

:: Integer

Number \(n\) whose root we want.

-> Integer

The power \(k\) of the root.

-> Maybe Integer

The root \(m\).

Compute the integer root to the given power. I.e., find \(m\) such that \(m^k = n\).

>>> root 27 3
Just 3
>>> root (-27) 3
Just (-3)
>>> root 2 2
Nothing