Version 0.30 : Rlyeh Mario's patch for Math Functions on VC++

master
pur3mail 13 years ago
parent f93728c1f7
commit 24c7399ccb

@ -94,6 +94,7 @@
Added shift operators
Version 0.29 : Added new object via functions
Fixed getString() for double on some platforms
Version 0.30 : Rlyeh Mario's patch for Math Functions on VC++
NOTE:
Constructing an array with an initial length 'Array(5)' doesn't work

@ -14,7 +14,7 @@
using namespace std;
#define k_E exp(1)
#define k_E exp(1.0)
#define k_PI 3.1415926535897932384626433832795
#define F_ABS(a) ((a)>=0 ? (a) : (-(a)))
@ -32,6 +32,35 @@ using namespace std;
#define scReturnInt(a) ( c->getReturnVar()->setInt(a) )
#define scReturnDouble(a) ( c->getReturnVar()->setDouble(a) )
#ifdef _MSC_VER
namespace
{
double asinh( const double &value )
{
double returned;
if(value>0)
returned = log(value + sqrt(value * value + 1));
else
returned = -log(-value + sqrt(value * value + 1));
return(returned);
}
double acosh( const double &value )
{
double returned;
if(value>0)
returned = log(value + sqrt(value * value - 1));
else
returned = -log(-value + sqrt(value * value - 1));
return(returned);
}
}
#endif
//Math.abs(x) - returns absolute of given value
void scMathAbs(CScriptVar *c, void *userdata) {
if ( scIsInt("a") ) {

Loading…
Cancel
Save