ref #29
* fix mac compile issue (include cmath)