oct accepts the octal, hex or binary representation of a number, a string, as argument. That string is converted to a number. Only pass strings to oct. It doesn't make sense to pass numbers to oct.
#!perl -l print 0255; # 173 print oct('255'); # 173 print oct(255); # 173 print oct(0xFF); # 173 print oct(0b11111111); # 173 print oct(250+5); # 173 print 255; # 255 print 0xFF; # 255 print 0b11111111; # 255 print 250+5; # 255 print 016; # 14 print oct('16'); # 14 print oct(16); # 14 print oct(0x10); # 14 print oct(0b00010000); # 14 print oct(10+6); # 14 print 16; # 16 print 0x10; # 16 print 0b00010000; # 16 print 10+6; # 16
In reply to Re: ' or no?
by ikegami
in thread ' or no?
by xiaoyafeng
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |