Binary, decimal, and hexadecimal values connected by arrows
View source on GitHubB1Z0N/numerical_sys

lablanguagesdataacademic

Numerical Systems

C numeral-system conversion exercise.
  • C
  • Base conversion
  • Numeral systems
  • Console program
Date
February 2018
Status
Historical
Visibility
Public

Converting numbers from one numerical system to another. A single C program that reads a number, its base, and a target base, converts through decimal, and prints the result.

It handles more than the usual integer-to-integer case: fractional parts are converted digit by digit after the point, and negative bases work too — a number can be converted into or out of a system like base −2, with the sign folded into the digits instead of written in front.