Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions base/src/math.act
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ def acosh(x: float)->float:
NotImplemented
def atanh(x: float)->float:
NotImplemented
def ldexp(x: float, exp: int)->float:
NotImplemented
7 changes: 7 additions & 0 deletions base/src/math.ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ double mathQ_acosh(double x) {
double mathQ_atanh(double x) {
return atanh(x);
}
double mathQ_ldexp(double x, int64_t exp) {
if (exp > (int64_t)INT_MAX || exp < (int64_t)INT_MIN) {
$RAISE(((B_BaseException)B_ValueErrorG_new($FORMAT("Exponent out of valid range for ldexp: %lld", (long long)exp))));
}

return ldexp(x, (int)exp);
}

void mathQ___ext_init__() {
//NOP
Expand Down