Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: hex numbers

by AnomalousMonk (Archbishop)
on Jan 14, 2021 at 17:37 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11126921]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-26 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found