Re: base_convert bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 28, 2014 at 7:51 AM, Radek Krejča <radek.krejca@xxxxxxxxxx>
wrote:

> > That's not a bug, they're both the same number. Leading zeros are
> > always ignored in number systems, and PHP doesn't attempt to format it
> > assuming and specific word size. Try the same conversion in your
> > computers calculator.
> >
> > To format the number as you wish for output, use printf or sprintf to
> > pad with leading zeros.
>
> [Radek Krejca]
> Thank you for response, but maybe it is not important when we talk about
> Decimal numbers , but with binary i think it is important to keep zeros
> ,because the position of bit in the string is very
> important , to construct its value , or in Decoding ,Encoding process , it
> will be also very important .
>
> Thank you
> Radek
>

Leading zeros are not important in a binary number. Any system can detect
that 00010000 == 10000. The leading zeros do not make a difference when it
comes to calculating the values.

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux