mp(2): clarify mptoa() and mpfmt() default base

This commit is contained in:
cinap_lenrek 2018-11-21 01:15:43 +01:00
parent 8e50556f14
commit 39a7be7ea3

View file

@ -372,7 +372,7 @@ and
.B mpint .B mpint
representations using the base indicated. representations using the base indicated.
Only the bases 2, 4, 8, 10, 16, 32, and 64 are Only the bases 2, 4, 8, 10, 16, 32, and 64 are
supported. Base 0 defaults to 16. supported.
.IR Strtomp .IR Strtomp
skips any leading spaces or tabs. skips any leading spaces or tabs.
.IR Strtomp 's .IR Strtomp 's
@ -397,18 +397,25 @@ If the parse terminates before any digits are found,
return return
.BR nil . .BR nil .
.I Mptoa .I Mptoa
returns a pointer to the filled buffer. returns a pointer to the
.SM ASCII
filled buffer.
If the parameter If the parameter
.I buf .I buf
is is
.BR nil , .BR nil ,
the buffer is allocated. the buffer is allocated.
Setting
.I base
to zero uses hexadecimal default.
.I Mpfmt .I Mpfmt
can be used with can be used with
.IR fmtinstall (2) .IR fmtinstall (2)
and and
.IR print (2) .IR print (2)
to print hexadecimal representations of to print
.SM ASCII
representations of
.BR mpint s. .BR mpint s.
The conventional verb is The conventional verb is
.LR B , .LR B ,
@ -416,6 +423,8 @@ for which
.I mp.h .I mp.h
provides a provides a
.LR pragma . .LR pragma .
The precisition in the format string changes the base,
defaulting to hexadecimal when omited.
.PP .PP
.I Mptobe .I Mptobe
and and