File: num_of_string.doc

package info (click to toggle)
hol-light 20120602-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 23,452 kB
  • sloc: ml: 348,797; cpp: 438; java: 279; makefile: 252; sh: 183; yacc: 108; perl: 78; ansic: 57; sed: 39
file content (27 lines) | stat: -rw-r--r-- 655 bytes parent folder | download | duplicates (7)
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
\DOC num_of_string

\TYPE {num_of_string : string -> num}

\SYNOPSIS
Converts decimal, hex or binary string representation into number.

\DESCRIBE
The call {num_of_string "n"} converts the string {"n"} into an OCaml
unlimited-precision number (type {num}). The string may be simply a sequence of
decimal digits (e.g. {"123"}), or a hexadecimal representation starting with
{0x} as in C (e.g. {"0xFF"}), or a binary number starting with {0b} (e.g.
{"0b101"}).

\FAILURE
Fails unless the string is a valid representation of one of these forms.

\EXAMPLE
{
  # num_of_string "0b11000000";;
  val it : num = 192
}

\SEEALSO
dest_numeral, mk_numeral.

\ENDDOC