![]() |
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:
|
I don't get it :S
What does floor() do? It basically just does int() :S |
The floor function finds the greatest integer less than or equal to a specified number. The ceiling function finds the smallest integer greater than or equal to a specifed number. These functions can be found in just about all programming languages.
In Graal, int(num) truncates the number, which in essence is what the floor function is supposed to do, so it's the same thing basically when using it on Graal. |
Yes int() acts different on normal C/C++ for negative numbers, int(-1.1) in graal is -2, while it's -1 in C/C++ which can mess up a lot of calculations.
|
| All times are GMT +2. The time now is 02:44 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.