The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #13852 from nojb/int_ops_doc

manual: clarify documentation of C macros on integers

authored by

Gabriel Scherer and committed by
GitHub
95f70213 63328807

+11 -4
+11 -4
manual/src/cmds/intf-c.etex
··· 701 701 702 702 \subsection{ss:c-int-ops}{Operations on integers} 703 703 704 + The header "<caml/config.h>" defines a C integer type "intnat" of signed 64-bit 705 + integers (32-bit integers on 32-bit architectures). This type is used to 706 + represent the integer encoded by a "value" corresponding to an unboxed integer 707 + without truncation. 708 + 704 709 \begin{itemize} 705 - \item "Val_long("\var{l}")" returns the value encoding the "long int" \var{l}. 706 - \item "Long_val("\var{v}")" returns the "long int" encoded in value \var{v}. 710 + \item "Val_long("\var{n}")" returns the value encoding the "intnat" \var{n}. 711 + \item "Long_val("\var{v}")" returns the "intnat" encoded in value \var{v}. 707 712 \item "Val_int("\var{i}")" returns the value encoding the "int" \var{i}. 708 - \item "Int_val("\var{v}")" returns the "int" encoded in value \var{v}. 713 + \item "Int_val("\var{v}")" returns the "int" encoded in value \var{v}. Note that 714 + this operation may result in a truncated value since "int" is 32-bit wide on 715 + 64-bit architectures. 709 716 \item "Val_bool("\var{x}")" returns the OCaml boolean representing the 710 717 truth value of the C integer \var{x}. 711 718 \item "Bool_val("\var{v}")" returns 0 if \var{v} is the OCaml boolean 712 719 "false", 1 if \var{v} is "true". 713 720 \item "Val_true", "Val_false" represent the OCaml booleans "true" and "false". 714 - \item "Val_emptylist", "Val_emptylist" represents the empty list. 721 + \item "Val_emptylist" represents the empty list. 715 722 \item "Val_none" represents the OCaml value "None". 716 723 \end{itemize} 717 724