cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Conversion between DECimal, BINary, HEXAdecimal and OCTal numbers...?

Cornel
18-Opal

Conversion between DECimal, BINary, HEXAdecimal and OCTal numbers...?

Hello,

How will look like a function or multiple functions in Mathcad Prime so that when I give it a DECimal number to convert that DECimal number into BINary, HEXAdecimal, and OCTal corresponding values? Or how to do these things in Mathcad Prime?

Case a) Input: DECimal number, Output: BINary, HEXAdecimal and OCTal corresponding values/numbers
Case b) Input: BINary number, Output: DECimal, HEXAdecimal and OCTal corresponding values/numbers
Case c) Input: HEXAdecimal number, Output: DECimal, BINary and OCTal corresponding values/numbers
Case d) Input: OCTal number, Output: DECimal, BINary and HEXAdecimal corresponding values/numbers

Like it is shown below an example for Case a):

Cornel_0-1703491715810.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:Cornel)

You're right, there's an error in there that I didn't spot yet.

This one should work fine.

 

Success!
Luc

View solution in original post

4 REPLIES 4
VladimirN
24-Ruby II
(To:Cornel)

LucMeekes
23-Emerald III
(To:Cornel)

The attached file contains conversion routines between any radix.

You can convert from decimal to binary, octal, decimal and hexadecimal, and any other combination of two, but also to radix 3, 4, 5, 6, 7, 9, 11, 12, 13, 14, 15, 17...

 

And it works in any version of Prime >= 4.

 

Success!
Luc

 

 

Cornel_0-1703494299295.png

Cornel_2-1703494319384.png

 

Cornel_3-1703494329578.png

Why are different values between the two?

 

Cornel_0-1703495122459.png

Cornel_2-1703494960107.png

Cornel_0-1703495202692.png

LucMeekes
23-Emerald III
(To:Cornel)

You're right, there's an error in there that I didn't spot yet.

This one should work fine.

 

Success!
Luc

Top Tags