|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-04-09 08:03 UTC] sutter at ecology dot at
echo (18/21); returns 0.857142857142861. right is 0.86; my configure command: './configure' '--prefix=/usr' '--with-config-file-path=/etc' '--disable-debug' '--enable-pic' '--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs' '--disable-static' '--enable-shared' '--with-exec-dir=/usr/bin' '--with-regex=system' '--with-gettext' '--with-gd' '--with-openssl'' -with-jpeg-dir=/usr' '--with-png' '--with-zlib' '--with-gdbm' '--with-kerberos' '--with-imap-ssl' '--enable-debugger' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-gd-imgstrttf' '--enable-yp' '--enable-ftp' '--without-mysql' '--with-xml' '--with-ttf' '--with-gnu-ld' '--with-mysql=shared,/usr' '--with-pgsql=shared,/usr' '--with-imap=shared,/usr' '--with-ldap=shared' PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 06:00:02 2025 UTC |
the really amusing thing is that THIS IS RIGHT. if you want it to give you a rounded figure, this code will help you: <?php printf("%0.2f", 18/21); ?>as the result is 1 - 1/7 it is periodic: ______ 0.857142 18 : 21 = 0,857142... 0 -- #1 180 168 (8x21) --- #2 120 105 (5x21) --- #3 150 147 (7x21) --- #4 30 21 (1x21) -- #5 90 84 (4x21) -- #6 60 42 (2x21) -- 18 (continue at #1)