From: dpvc v. a. <we...@ma...> - 2009-11-04 17:32:25
|
Log Message: ----------- Fix problem with useBaseTenLog in perl code Modified Files: -------------- pg/macros: PGcommonFunctions.pl dangerousMacros.pl Revision Data ------------- Index: dangerousMacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/dangerousMacros.pl,v retrieving revision 1.56 retrieving revision 1.57 diff -Lmacros/dangerousMacros.pl -Lmacros/dangerousMacros.pl -u -r1.56 -r1.57 --- macros/dangerousMacros.pl +++ macros/dangerousMacros.pl @@ -1358,4 +1358,25 @@ # ^uses &Value::Package sub Infinity () {Value->Package("Infinity")->new()} + +# ^function abs +# ^function sqrt +# ^function exp +# ^function log +# ^function sin +# ^function cos +# ^function atan2 +# +# Allow these functions to be overridden +# (needed for log() to implement $useBaseTenLog) +# +use subs 'abs', 'sqrt', 'exp', 'log', 'sin', 'cos', 'atan2'; +sub abs($) {return CORE::abs($_[0])}; +sub sqrt($) {return CORE::sqrt($_[0])}; +sub exp($) {return CORE::exp($_[0])}; +sub log($) {return CORE::log($_[0])}; +sub sin($) {return CORE::sin($_[0])}; +sub cos($) {return CORE::cos($_[0])}; +sub atan2($$) {return CORE::atan2($_[0],$_[1])}; + 1; Index: PGcommonFunctions.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGcommonFunctions.pl,v retrieving revision 1.8 retrieving revision 1.9 diff -Lmacros/PGcommonFunctions.pl -Lmacros/PGcommonFunctions.pl -u -r1.8 -r1.9 --- macros/PGcommonFunctions.pl +++ macros/PGcommonFunctions.pl @@ -41,7 +41,7 @@ } sub log {CORE::log($_[1])} -sub ln {CORE::log($_[1])} +sub ln {CORE::log($_[1])} sub logten {CORE::log($_[1])/CORE::log(10)} sub tan {CORE::sin($_[1])/CORE::cos($_[1])} @@ -98,7 +98,8 @@ # which package-specific version to call # -sub ln {CommonFunction->Call('log',@_)} +sub log {CommonFunction->Call('log',@_)} +sub ln {CommonFunction->Call('ln',@_)} sub logten {CommonFunction->Call('logten',@_)} sub tan {CommonFunction->Call('tan',@_)} |