libuninum

libuninum is a library that will allow you to convert Unicode strings to numbers and numbers to Unicode strings
Download

libuninum Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Publisher Name:
  • Bill Poser
  • Publisher web site:
  • http://billposer.org/Software/WordGenerator.html
  • Operating Systems:
  • Windows All
  • File Size:
  • 413 KB

libuninum Tags


libuninum Description

libuninum is a library that will allow you to convert Unicode strings to numbers and numbers to Unicode strings. Standard functions like strtoul, strtod, and sprintf do this for numbers written in the usual Western number system using the Indo-Arabic numerals, but they do not handle other number systems. The main functions take as input a UTF-32 Unicode string and compute the corresponding unsigned integer. Internal computation is done using arbitrary precision arithmetic, so there is no limit on the size of the integer that can be converted. The value of the string is returned in one of three forms. One option is a string of ASCII characters containing the decimal representation of the integer using the Indo-Arabic digits. This option has the virtue of avoiding any possibility of overflow or truncation. The second option is to obtain the value as a GNU MP mpz_t object. This is only useful if you are going to do further computation using GNU MP. The final option is to obtain the value as an unsigned long integer. If you are going to do internal calculations, this is probably the most convenient option, but some numbers (in fact, infinitely many) will not fit into an unsigned long integer. The library guarantees that no overflow or truncation will occur; if the number will not fit, it sets an error flag and returns 0. An inverse function accepts as input an unsigned long integer, an mpz_t object, or an ASCII decimal string and converts it to a Unicode string in a selected number system.


libuninum Related Software