1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "print_integer.h"

// IMPLEMENTATION FILE

// function definition of print_integer()

#include <stdio.h>
#include "print_integer.h"

// Function DEFINITION for print_integer(…) -- include body (statements inside {…})

void print_integer(int n, int radix, char* prefix) {

    fputc('0', stdout);

    // n is just a quantity.
    // Quantities have no number base.
    // int variables have no number base.
    //
    // Number bases are only relevant when you "express" a number as individual digit characters.
    //
    // When we write a number, we write it in a specific number base.
    //
    // When we interpret a number, we interpret it relative to some number base.
    // ∙ 11 would be eleven in base ten.
    // ∙ 11 would be three  in base two.
    // ∙ 11 would be nine   in base eight.
    // ∙ 11 would be ten    in base nine.
}

© Copyright 2022 Alexander J. Quinn         This content is protected and may not be shared, uploaded, or distributed.