File: num_of_string.doc

package info (click to toggle)
hol-light 20190729-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 42,676 kB
  • sloc: ml: 637,078; cpp: 439; makefile: 301; lisp: 286; java: 279; sh: 239; yacc: 108; perl: 78; ansic: 57; sed: 39; python: 13
file content (27 lines) | stat: -rw-r--r-- 655 bytes parent folder | download | duplicates (6)
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