SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru phantom007's Avatar
    Join Date
    May 2008
    Posts
    725
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Question Data types in PHP

    Hi

    I was going through the official doc of php for data types http://php.net/manual/en/language.types.php

    It seems php does not support long data type. So is double the only datatype in php that supports the highest rage of value?


    Thanks

  2. #2
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,075
    Mentioned
    53 Post(s)
    Tagged
    0 Thread(s)
    A better page to look at might be here: http://php.net/manual/en/language.types.integer.php

    The big thing to remember is that PHP doesnt handle these large numbers well, especially when it comes to comparison. See http://www.php.net/manual/en/book.bc.php for manipulating large numbers.

  3. #3
    SitePoint Guru phantom007's Avatar
    Join Date
    May 2008
    Posts
    725
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    So if php does not handle large numbers, what is the work around for this?

    Thanks

  4. #4
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,075
    Mentioned
    53 Post(s)
    Tagged
    0 Thread(s)
    I suppose I didn't word it correctly. Understand that PHP is built on top of C. The standard operators may not be able to handle large integers, but there are libraries that link directly to C extensions that can.

    The link to the library I posted is your work around.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •