![]() |
Quote:
|
Quote:
I did a quick test on RC. int(7.999) returns 7, but int(7.9999) returns 8. int(7.9998) returns 7, as well as int(7.999899999). Considering that 7.9999 and 7.999969482 have one thing in common, it's safe to assume that when Graal sees ".9999", it'll round up to the nearest whole number. Quote:
|
Quote:
|
Huh. & might work, never tried it before;
The way I've got it set up Now is, it keeps an array of rooms that connect to other rooms; the array index is the room in question, the value at that index is a bitflag of which rooms it connects to (1 means 1, 2 means 2 and not 1, 3 means 2 and 1, 4 means 3, 5 means 3 and 1, etc). When it links two rooms it simply adds the values to combine the list of linked rooms, and then updates not just those 2 rooms but every room that links to those 2 rooms. Moral of the story is, & might work for me, but it's not gonna make me happy; what, I have to revise every int(random(0,2)) now to have a special case for if it returns 2?! |
Quote:
|
Quote:
PHP Code:
Quote:
|
Pseudo-bitwise operation on what amounts to floating point numbers are a bit scary. :\
|
Interesting stuff on the whole rounding issue to anyone who is interested: http://wiki.php.net/rfc/rounding
|
| All times are GMT +2. The time now is 03:56 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.