|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1999-04-18 12:55 UTC] maarnold at gte dot net
floor(), ceil(), intval() all return 2 byte int. Large floats get rolled over by floor() and ceil(). Long strings get rolled over by intval(). I'm trying to create a web based postgress database manager and I'm having a bit of trouble supporting the int4 data type. The php documentation on type manipulation says that integers are treated as longs. You might just want to have floor(), ceil(), and intval() always return a long. That may be easiest. I saw the bug report from the guy with the mysql database. My application is also a "serious" database app; but I'm not quite so vindictive. Thanks PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Jun 16 14:00:01 2026 UTC |
They do return longs. For example, floor() does this: if (value->type == IS_DOUBLE) { RETURN_LONG((long)floor(value->value.dval)); } You probably want to have a look at the bcmath functions instead.