Roman Numeral Conversion API
SourceForge.net Logo
README
ChangeLog
Screen Shots
SourceForge Resources
Download
Report Bugs
Browse CVS
Man Pages
roman(7)
int2roman(3)
roman2int(3)
roman_asctime(3)
roman_ctime(3)
roman_strftime(3)
romandate(1)
romannum(1)
Examples
int2roman.c
roman2int.c
roman_asctime.c
roman_ctime.c
roman_strftime.c
 
ROMAN2LONG

ROMAN2LONG


NAME

roman2int − convert ASCII string containing a Roman Numeral value to signed int.

LIBRARY

Roman Numeral Conversion API (libroman, -lroman)

SYNOPSIS

#include <roman.h>

int
roman2int
(const char * str);

DESCRIPTION

The function roman2int takes an argument of str and returns an integer containing the value of the Roman Numeral.

RETURN VALUES

If successful, roman2int returns the numeric value of str or −1 if an error occurred (in which case, errno is set appropriately).

ERRORS

EFAULT

bad address in str.

EINVAL

str contains either invalid characters or an invalid Roman numeral.

EXAMPLES

int num;

num = roman2int("MCMXCVII");
if (num == −1)
perror("roman2int");
else
printf("MCMXCVII == %i\n", num);

AUTHOR

Written by David M. Syzdek.

REPORTING BUGS

Report bugs to <syzdek@users.sourceforge.net>.

COPYRIGHT

Copyright (C) 2007 David M. Syzdek.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SEE ALSO

roman(7), romandate(1), romannum(1), int2roman(3), roman_ctime(3), roman_strftime(3)