Skip to content

Commit af486f6

Browse files
committed
add arb_log_base_ui
1 parent e45f485 commit af486f6

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/flint/flintlib/arb.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ cdef extern from "flint/arb.h":
183183
void arb_log_ui(arb_t z, ulong x, long prec)
184184
void arb_log_fmpz(arb_t z, const fmpz_t x, long prec)
185185
void arb_log1p(arb_t z, const arb_t x, long prec)
186+
void arb_log_base_ui(arb_t z, const arb_t x, ulong b, long prec)
186187
void arb_exp(arb_t z, const arb_t x, long prec)
187188
void arb_expm1(arb_t z, const arb_t x, long prec)
188189
void arb_sin(arb_t s, const arb_t x, long prec)

src/flint/types/arb.pyx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,16 @@ cdef class arb(flint_scalar):
809809
arb_log1p((<arb>u).val, (<arb>s).val, getprec())
810810
return u
811811

812+
def log_base_ui(s, ulong b):
813+
r"""Returns `\log_b(s)`, computed exactly when possible.
814+
815+
>>> arb(2048).log_base_ui(2)
816+
11.0000000000000
817+
"""
818+
u = arb.__new__(arb)
819+
arb_log_base_ui((<arb>u).val, (<arb>s).val, b, getprec())
820+
return u
821+
812822
def sin(s):
813823
r"""
814824
Sine function `\sin(s)`.

0 commit comments

Comments
 (0)