# Hexadecimal, octal, binary, oh my! [duplicate]

This is a code golf puzzle: shortest byte count wins. The program should do the following (Standard loopholes forbidden):

2. Convert to octal
3. Then interpret the digits as if in decimal (765 octal -> 765 decimal)
4. Divide the number by two

## Example:

Input: 4a3d

Octal: 45075

Same number interpreted as decimal: 45075

Divide by 2: 22537.5

Output: 5809.8

## marked as duplicate by Xcali, Sriotchilism O'Zaic code-golf StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 14 '18 at 14:57

• What's with the downvote? – Redwolf Programs Apr 14 '18 at 14:38
• Welcome to PPCG! I'm not the downvoter, but personally I'd vote this as a duplicate of base-conversion challenge, since that's the same, just repeated. I'd suggest you to use our sandbox next time, it can help detect potential problems in the challenge. – RedClover Apr 14 '18 at 14:44
• Hello, welcome to the site. I downvoted this challenge because it is a series of tasks, with no real motivation. I don't think the challenge is interesting. That being said don't feel discouraged to keep writing questions. Just because I think this challenge is bad doesn't mean I think you won't write good challenges in the future. – Sriotchilism O'Zaic Apr 14 '18 at 15:03
• The most recent challenge I have upvoted was this. The main criteria I look for in a question are 1) Whether the challenge offers something new I haven't seen before 2) Whether the challenge is cohesive, that is whether its internal parts make sense with one another. 3) an arbitrary do I think it is fun criterion. If you want to get good at writing challenges I would suggest reading this. You might also look at this. – Sriotchilism O'Zaic Apr 14 '18 at 15:14
• @SriotchilismO'Zaic It's been about a year since I created this question. Thanks for the feedback you gave, as it really helped me in future questions to avoid this mistake! – Redwolf Programs May 3 at 23:38

# Perl 6, 30 bytes

{(:16(\$_).base(8)/2).base(16)}


Try it online!

# Javascript,5653 52 bytes

-3 bytes thanks to @ovs

-1 byte thanks to @Arnauld

p=parseInt,a=>(p(p(a,16)[s='toString'](8))/2)[s](16)


toString on an integer converts the integer to a string in that base.

Try it online!

• Had no idea the .toString(base) thing existed. Upvote for teaching me something new! – Redwolf Programs Apr 14 '18 at 14:45