With that reasoning, there are no binary numbers. There are no octal numbers. There are no decimal numbers. Yet, anyone understands what you mean if you talk about 'binary numbers' or 'octal 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.

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
Each time it mentions 'binary number', it means 'the representation of a number in binary'.

Abigail


In reply to Re: binary numbers by Abigail-II
in thread binary numbers by mAineAc

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.