🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #219985

Re: za duza liczba?

#219985
From: Lemat
Date: Mon, 03 Aug 2009 11:04
44 lines
2264 bytes
albert wrote:

> Do bazy danych pola SET dodaje zaznaczone checkboxy. nie ma problemu jesli
> jest ich w sumie do 32 (ja mam 38), potem zaczynaja sie schody. Dlaczego
> zaznaczajac checkboxa po numerze 32 porownanie array_sum($_POST['table'] &
> $in nie odzanacza go? Przed 32 nie ma zadnego problemu...
> 
> $in = 1;
> for($i=1;$i<=38;$i++) {
> echo '<input type="checkbox" name="table[]"
> value="'.$in.'"'.(array_sum($_POST['table'] & $in?' checked':'').'><label
> for="table'.$i.'">'.$formularz['wartosc'][$i-1].'</label>';
>   $in = $in * 2;}
> 
> kiedy wyswietlam
> $in = 1;
> for($i=1;$i<=64;$i++)
> {
> echo $i.' '.$in.'<br>';
> $in = $in * 2;
> }
> 
> 39. 274877906944
> 40. 549755813888
> 41. 1.09951162778E+12
> 42. 2.19902325555E+12
> 
> 
> ale to dopiero po 40 a ja mam problem od 32

operacja & tak naprawdę potrzebuje integera aby dobrze pracować

http://www.php.net/manual/en/language.types.integer.php

The size of an integer is platform-dependent, although a maximum value of 
about two billion is the usual value (that's 32 bits signed). PHP does not 
support unsigned integers. Integer size can be determined using the constant 
PHP_INT_SIZE, and maximum value using the constant PHP_INT_MAX since PHP 
4.4.0 and PHP 5.0.5. 

http://www.php.net/manual/en/book.bc.php
-- 
Pozdrawiam
Lemat
Technical Details
Message-ID: <h56grd$5tg$1@nemesis.news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mail
References: <h569e8$tns$1@news.onet.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mail
From: Lemat <#@lemat.priv.pl>
Newsgroups: pl.comp.lang.php
Subject: Re: za duza liczba?
Followup-To: pl.comp.lang.php
Date: Mon, 03 Aug 2009 13:04:57 +0200
Organization: lemat.priv.pl
Lines: 46
Message-ID: <h56grd$5tg$1@nemesis.news.neostrada.pl>
References: <h569e8$tns$1@news.onet.pl>
NNTP-Posting-Host: troll.lemat.priv.pl
Mime-Version: 1.0
X-Trace: nemesis.news.neostrada.pl 1249298093 6064 79.190.106.117 (3 Aug 2009 11:14:53 GMT)
X-Complaints-To: usenet@news.neostrada.pl
NNTP-Posting-Date: Mon, 3 Aug 2009 11:14:53 +0000 (UTC)
User-Agent: KNode/0.99.01
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit