Roman Numeral Conversion API 0.0.4

Roman Numeral Conversion API project was developed to provide an easy method of including Roman Numeral values...

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!
send us
an update
LICENSE TYPE:
GPL (GNU General Public License) 
USER RATING:
2.7/5 14
DEVELOPED BY:
David M. Syzdek
HOMEPAGE:
roman.sourceforge.net
CATEGORY:
ROOT \ Utilities
Roman Numeral Conversion API project was developed to provide an easy method of including Roman Numeral values in the output of programs written in C/C . There are example programs that demonstrates the use of the functions included in the library. The utilities `romannum' and `romandate' show possible uses for the functions as well as provide silly tools to play with.

Programming Examples

The first example demonstrates generating Roman Numeral strings from an integer:

/* compile with gcc -lroman -o test1 test1.c */
#include
#include

int main(void);

int main(void)
{
const char * roman;
roman = long2roman(3132);
if (!(roman))
{
perror("long2roman()");
return(1);
};
printf("Roman Numeral: %sn", roman);
return(0);
}

If the above program is run on a Posix system, the output should be similiar to the following:

syzdek@tacntock$ gcc -lroman -o test1 test1.c
syzdek@tacntock$ ./test1
Roman Numeral: MMMCXXXII
syzdek@tacntock$

The second example demonstrates converting a Roman Numeral string into an integer:

/* compile with gcc -lroman -o test2 test2.c */
#include
#include

int main(void);

int main(void)
{
int num;
num = roman2long("MMMCXXXII");
if (num < 0)
{
perror("roman2long()");
return(1);
};
printf("Number: %in", num);
return(0);
}


If the above program is run on a Posix system, the output should be similiar to the following:

syzdek@tacntock$ gcc -lroman -o test2 test2.c
syzdek@tacntock$ ./test2
Number: 3132
syzdek@tacntock$

Additional examples are included in the `examples' directory.

Last updated on February 3rd, 2008

#numeral conversion #conversion API #latin charaters #roman #latin #numeral #conversion

Add your review!

SUBMIT