# Assign to Math. class

**URL:** <https://forum.kirupa.com/t/assign-to-math-class/263710>\
**Category:** Uncategorized\
**Created:** [June 18, 2008, 3:09pm UTC](https://forum.kirupa.com/t/assign-to-math-class/263710 "2008-06-18T15:09:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![7788](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/7788/32/2860_2.png) [@7788](https://forum.kirupa.com/u/7788)\
**Post date:** [June 18, 2008, 3:09pm UTC](https://forum.kirupa.com/t/assign-to-math-class/263710/1 "2008-06-18T15:09:43Z")

</div>

i remember seeing an example where one can assign additional functions to the math class.  
Dose anyone know how exactly to do that?

I tried:

class Math {

```
function get phi():Number {
return (1+Math.sqrt(5))/2;
}

```

}

in a math.as  
flash outputs

The class ‘math’ needs to be defined in a file whose relative path is ‘math.as’.  
class math {

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 18, 2008, 3:40pm UTC](https://forum.kirupa.com/t/assign-to-math-class/263710/2 "2008-06-18T15:40:02Z")

</div>

you mean math as in the function within flash or a math.class AS file?

you can “extend” math in a class file I guess

_rants on the evils of class files_
