View Single Post
  #1  
Old 05-17-2009, 02:57 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
floor() and ceil() functions

After testing the floor() function I came to realize that it does not work. To double check, I asked napo to test it out, and he also concluded that it does not work. While noticing that the floor() function does not work, I realized that there is also not a ceil() function (or at least I can't find one anywhere), so I made both in hopes that it's updated into the engine.


Simple enough, really:

PHP Code:
public function ceil(num) {
 if (
int(num) != num)
  return 
int(num) + 1;
 else return 
num;
}

public function 
floor(num) {
 return 
int(num);

Reply With Quote