# Expr Node

**URL:** <http://forum.vvvv.org/t/expr-node/332>\
**Category:** general\
**Created:** [May 4, 2005, 12:58pm UTC](http://forum.vvvv.org/t/expr-node/332 "2005-05-04T12:58:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![markus4](http://forum.vvvv.org/letter_avatar_proxy/v2/letter/m/999999/32.png) [@markus4](http://forum.vvvv.org/u/markus4)\
**Post date:** [May 4, 2005, 12:58pm UTC](http://forum.vvvv.org/t/expr-node/332/1 "2005-05-04T12:58:07Z")

</div>

round(0.5) = 0 but it has to be 1 !

arctan() is not implementet

DIV and MOD gives wrong results!

ARG has bugs

COTAN has bugs… etc etc

---

<div class="post-metadata">

**Author:** ![oschatz](http://forum.vvvv.org/letter_avatar_proxy/v2/letter/o/999999/32.png) [@oschatz](http://forum.vvvv.org/u/oschatz)\
**Post date:** [May 4, 2005, 8:11pm UTC](http://forum.vvvv.org/t/expr-node/332/2 "2005-05-04T20:11:15Z")

</div>

ok. this node has some secrets… there is a little help page at [FAQ Expr](https://vvvv.org/documentation/FAQ-Expr)

> round(0.5) = 0 but it has to be 1 !

i think this the default behaviour of the used rounding function - which does commercial rounding. values right in the middle between two integers are rounded to the next even number: round(0.5)=0, round(1.5)=2, round(2.5)=2, round(3.5)=4. while this helps bankers to distribute rounding errors between creditors and debitors, it may be somehow unintuitive to all mathematicians. trunc is usually your friend

> arctan() is not implemented

try arctan2(x, y) which calculates arctan(x/y).  
arctan2 handles the y=0 case quite nice.

> DIV and MOD gives wrong results!  
> ARG has bugs  
> COTAN has bugs… etc etc

okok… i had some similar experiences sometime. can you give an example?

---

<div class="post-metadata">

**Author:** ![markus4](http://forum.vvvv.org/letter_avatar_proxy/v2/letter/m/999999/32.png) [@markus4](http://forum.vvvv.org/u/markus4)\
**Post date:** [May 5, 2005, 11:17am UTC](http://forum.vvvv.org/t/expr-node/332/3 "2005-05-05T11:17:44Z")

</div>

A DIV B should be  
|A/B|

A MOD B should be  
A - |A/B| \*B  
while | | are the GaussianBrackets aka floor()

Ex: in vvvv  
3.6 MOD 2 is 0 but it has to be 1.6  
3.6 DIV 2 is 2 but it has to be 1

> oschatz:  
> ok. this node has some secrets… there is a little help page at [FAQ Expr](https://vvvv.org/documentation/FAQ-Expr)
> 
> > round(0.5) = 0 but it has to be 1 !
> 
> i think this the default behaviour of the used rounding function - which does commercial rounding. values right in the middle between two integers are rounded to the next even number: round(0.5)=0, round(1.5)=2, round(2.5)=2, round(3.5)=4. while this helps bankers to distribute rounding errors between creditors and debitors, it may be somehow unintuitive to all mathematicians. trunc is usually your friend
> 
> > arctan() is not implemented
> 
> try arctan2(x, y) which calculates arctan(x/y).  
> arctan2 handles the y=0 case quite nice.
> 
> > DIV and MOD gives wrong results!  
> > ARG has bugs  
> > COTAN has bugs… etc etc
> 
> okok… i had some similar experiences sometime. can you give an example? [[[[[[[[[[[[[[[[[[[[Ã¹Ã­Ã­

---

<div class="post-metadata">

**Author:** ![oschatz](http://forum.vvvv.org/letter_avatar_proxy/v2/letter/o/999999/32.png) [@oschatz](http://forum.vvvv.org/u/oschatz)\
**Post date:** [May 5, 2005, 12:07pm UTC](http://forum.vvvv.org/t/expr-node/332/4 "2005-05-05T12:07:29Z")

</div>

thanks, i´ll look into that…
