Math.cpp File Reference

#include <cmath>
#include <string>
#include "tu_random.h"
#include "fn_call.h"
#include "GMath.h"
#include "log.h"
#include "tu_math.h"

Namespaces

namespace  gnash

Defines

#define MATH_WRAP_FUNC1(funcname)
#define MATH_WRAP_FUNC2_EXP(funcname, expr)

Functions

void gnash::math_init (as_object *s_global)
 gnash::MATH_WRAP_FUNC2_EXP (atan2,(atan2(arg0, arg1))) MATH_WRAP_FUNC2_EXP(max
arg0 arg1 arg0< arg1?arg0:arg1))
MATH_WRAP_FUNC2_EXP(pow,(pow(arg0, arg1))) void math_random(const fn_call &fn){fn.result-> 
gnash::set_double (tu_random::next_random()/double(uint32_t(0x0FFFFFFFF)))
void gnash::math_round (const fn_call &fn)
void gnash::math_new (const fn_call &fn)
void gnash::math_abs (const fn_call &fn)

Variables

arg0 arg1 gnash::arg0

Define Documentation

#define MATH_WRAP_FUNC1 funcname   ) 
 

Value:

void    math_##funcname(const fn_call& fn)                                              \
        {                                                                                       \
                double  arg = fn.arg(0).to_number();                                            \
                fn.result->set_double(funcname(arg));                                           \
        }

#define MATH_WRAP_FUNC2_EXP funcname,
expr   ) 
 

Value:

void    math_##funcname(const fn_call& fn)                                                                              \
        {                                                                                                                       \
                double  arg0 = fn.arg(0).to_number();                                                                           \
                double  arg1 = fn.arg(1).to_number();                                                                           \
                fn.result->set_double(expr);                                                                                    \
        }


Generated on Thu Nov 23 22:31:32 2006 for Gnash by  doxygen 1.4.6