I have fixed this two methods on my repository backup, please consider conver them to function's.
trunc(x) {
return x > 0 ? Math.floor(x) : Math.ceil(x);
}
fracc(x) {
return x > 0 ? x - Math.floor(x) : x - Math.ceil(x);
}