Skip to content

Commit 055d459

Browse files
authored
Add C++ cbrt() function for reals (FreeFem#352)
1 parent ada8440 commit 055d459

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/fflib/AFunction.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,7 @@ void Init_map_type()
16271627

16281628
Global.Add("atan","(",new OneOperator2<double>(atan2));
16291629
Global.Add("sqrt","(",new OneOperator1<double>(sqrt,2));
1630+
Global.Add("cbrt","(",new OneOperator1<double>(cbrt,2));
16301631
Global.Add("abs","(",new OneOperator1<double>(Abs));
16311632
Global.Add("abs","(",new OneOperator1<long>(Abs));
16321633
Global.Add("cos","(",new OneOperator1_<Complex>(cos));

src/fflib/array_real.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ void initArrayOperatordouble() {
4747
Add<KN_rmeps<K> >("(","",new OneOperator2<KN_<K>,KN_rmeps<K>,double>(rmeps));
4848
Global.Add("fabs", "(", new OneOperator1F_KN_<F_KN_<K, K, K, KK>, K, KK, KN_<K> >(fabs));
4949
Global.Add("abs", "(", new OneOperator1F_KN_<F_KN_<K, K, K, KK>, K, KK, KN_<K> >(fabs));
50+
Global.Add("cbrt","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(cbrt));
5051
Global.Add("acos", "(", new OneOperator1F_KN_<F_KN_<K, K, K, KK>, K, KK, KN_<K> >(acos));
5152
Global.Add("asin", "(", new OneOperator1F_KN_<F_KN_<K, K, K, KK>, K, KK, KN_<K> >(asin));
5253
Global.Add("atan", "(", new OneOperator1F_KN_<F_KN_<K, K, K, KK>,K, KK, KN_<K> >(atan));

0 commit comments

Comments
 (0)