Merge pull request #364 from triska/master

Documentation addition, and correction of error term
This commit is contained in:
Mark Thom
2020-04-18 22:54:17 -03:00
committed by GitHub
2 changed files with 13 additions and 12 deletions

View File

@@ -60,7 +60,7 @@ extend_var_list_([V|Vs], N, VarList, NewVarList, VarType) :-
get_single_char(C) :- get_single_char(C) :-
( var(C) -> '$get_single_char'(C) ( var(C) -> '$get_single_char'(C)
; atom_length(C, 1) -> '$get_single_char'(C) ; atom_length(C, 1) -> '$get_single_char'(C)
; throw(error(domain_error(in_character, C), get_single_char/1)) ; throw(error(type_error(in_character, C), get_single_char/1))
). ).

View File

@@ -28,6 +28,7 @@
if N is 0 or omitted, no decimal point is used. if N is 0 or omitted, no decimal point is used.
~ND like ~Nd, separating digits to the left of the decimal point ~ND like ~Nd, separating digits to the left of the decimal point
in groups of three, using the character "," (comma) in groups of three, using the character "," (comma)
~| place a tab stop at this position
~N| where N is an integer: place a tab stop at text column N ~N| where N is an integer: place a tab stop at text column N
~N+ where N is an integer: place a tab stop N characters ~N+ where N is an integer: place a tab stop N characters
after the previous tab stop (or start of line) after the previous tab stop (or start of line)
@@ -340,11 +341,11 @@ Cs = [cell(0,4,[glue(' ',_38),chars([a]),glue(' ',_62)])].
?- phrase(format_("hello~n~tthere~6|", []), Ls). ?- phrase(format_("hello~n~tthere~6|", []), Ls).
?- format("~ta~t~4|", []). ?- format("~ta~t~4|", []).
a true a true
; false. ; false.
?- format("~ta~tb~tc~10|", []). ?- format("~ta~tb~tc~10|", []).
a b ctrue a b c true
; false. ; false.
?- format("~tabc~3|", []). ?- format("~tabc~3|", []).
@@ -352,29 +353,29 @@ Cs = [cell(0,4,[glue(' ',_38),chars([a]),glue(' ',_62)])].
?- format("~ta~t~4|", []). ?- format("~ta~t~4|", []).
?- format("~ta~t~tb~tc~20|", []). ?- format("~ta~t~tb~tc~20|", []).
a b ctrue a b c true
; false. ; false.
?- format("~2f~n", [3]). ?- format("~2f~n", [3]).
3.00 3.00
true true
?- format("~20f", [0.1]). ?- format("~20f", [0.1]).
0.10000000000000000000true % this should use higher accuracy! 0.10000000000000000000 true % this should use higher accuracy!
; false. ; false.
?- X is atan(2), format("~7f~n", [X]). ?- X is atan(2), format("~7f~n", [X]).
1.1071487 1.1071487
X = 1.1071487177940906 X = 1.1071487177940906
?- format("~`at~50|~n", []). ?- format("~`at~50|~n", []).
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
true true
?- format("~t~N", []). ?- format("~t~N", []).
?- format("~q", [.]). ?- format("~q", [.]).
'.'true '.' true
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -