Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: hex numbers

by AnomalousMonk (Bishop)
on Jan 14, 2021 at 17:37 UTC ( #11126921=note: print w/replies, xml ) Need Help??


in reply to hex numbers

Also note that oct mimics hex for raw octal numeric strings and for all other common, non-decimal-base numeric strings given the appropriate prefix.

Win8 Strawberry 5.8.9.5 (32) Thu 01/14/2021 12:26:05 C:\@Work\Perl\monks >perl -Mstrict -Mwarnings for my $s (qw(376 37_6 0376 0_376 0xfe 0xf_e 0b11111110 0b1111_1110)) +{ print "'$s' "; die 'Ooops...' unless oct $s == 254; } print "\n"; print "all ok \n"; ^Z '376' '37_6' '0376' '0_376' '0xfe' '0xf_e' '0b11111110' '0b1111_1110' all ok


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11126921]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2021-05-14 08:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (149 votes). Check out past polls.

    Notices?