in reply to Re: binary numbers
in thread binary numbers
Admit it, it's much easier to talk about "binary numbers" than "binary representations of numbers". Even in the PODs we speak of binary numbers when we mean the representation.
Each time it mentions 'binary number', it means 'the representation of a number in binary'.Binary number > 0b11111111111111111111111111111111 non- portable (W portable) The binary number you specified is larger than 2**32-1 (4294967295) and therefore non-portable between systems. See perlport for more on portability concerns. Illegal binary digit %s ignored (W digit) You may have tried to use a digit other than 0 or 1 in a binary number. Interpretation of the binary number stopped before the offending digit. Integer overflow in %s number (W overflow) The hexadecimal, octal or binary number you have specified either as a literal or as an argu- ment to hex() or oct() is too big for your architec- ture, and has been converted to a floating point num- ber. On a 32-bit architecture the largest hexadeci- mal, octal or binary number representable without overflow is 0xFFFFFFFF, 037777777777, or 0b11111111111111111111111111111111 respectively. Note that Perl transparently promotes all numbers to a floating point representation internally--subject to loss of precision errors in subsequent operations. -- perldiag SYNOPSIS $n = 1234; # decimal integer $n = 0b1110011; # binary integer $n = 01234; # octal integer $n = 0x1234; # hexadecimal integer $n = 12.34e-56; # exponential notation $n = "-12.34e56"; # number specified as a string $n = "1234"; # number specified as a string -- perlnumber grok_bin converts a string representing a binary number to numeric form. The hex number may optionally be prefixed with "0b" or "b" unless "PERL_SCAN_DISALLOW_PREFIX" is set in *flags on entry. If "PERL_SCAN_ALLOW_UNDER- SCORES" is set in *flags then the binary number may use '_' characters to separate digits. -- perlapi
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: binary numbers
by duff (Parson) on Jan 30, 2004 at 16:50 UTC |