mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
Change tilde_space to be 0 by default
This commit is contained in:
13
CHANGES
13
CHANGES
@@ -25,17 +25,18 @@ The following are the changes from calc version 2.14.2.0 to date:
|
||||
|
||||
Added config("tilde_space", boolean). The "tilde_space" controls
|
||||
whether or not a space (' ') is printed after leading tilde ('~').
|
||||
By default, config("tilde_space") is true, which is a change
|
||||
from past behavior. For example, now:
|
||||
By default, config("tilde_space") is false.
|
||||
|
||||
; 1/3
|
||||
~ 0.33333333333333333333
|
||||
|
||||
With config("tilde_space", 0):
|
||||
For example, with the default, config("tilde_space", 0):
|
||||
|
||||
; 1/3
|
||||
~0.33333333333333333333
|
||||
|
||||
With config("tilde_space", 1):
|
||||
|
||||
; 1/3
|
||||
~ 0.33333333333333333333
|
||||
|
||||
To disable "tilde_space", use config("tilde_space", 0) on the
|
||||
command line and/or use config("tilde_space", 0),; in your ~/.calcrc.
|
||||
Thanks goes to <GitHub use ljramalho> for this suggestion.
|
||||
|
@@ -2033,8 +2033,8 @@ define test_mode()
|
||||
'1685: str(0xffffffff) == \"4.294967295e9\"');
|
||||
vrfy(str(3e9) == "3e9", \
|
||||
'1686: str(3e9) == \"3e9\"');
|
||||
vrfy(str(1/3) == "~ 3.33333333333333333333e-1", \
|
||||
'1687: str(1/3) == \"~ 3.33333333333333333333e-1\"');
|
||||
vrfy(str(1/3) == "~3.33333333333333333333e-1", \
|
||||
'1687: str(1/3) == \"~3.33333333333333333333e-1\"');
|
||||
vrfy(str(2e8) == "2e8", \
|
||||
'1688: str(2e8) == \"2e8"');
|
||||
vrfy(str(200e6) == "2e8", \
|
||||
@@ -2054,8 +2054,8 @@ define test_mode()
|
||||
'1695: str(0xffffffff) == \"4.294967295e9\"');
|
||||
vrfy(str(3e9) == "3e9", \
|
||||
'1696: str(3e9) == \"3e9\"');
|
||||
vrfy(str(1/3) == "~ 333.33333333333333333333e-3", \
|
||||
'1697: str(1/3) == \"~ 333.33333333333333333333e-3\"');
|
||||
vrfy(str(1/3) == "~333.33333333333333333333e-3", \
|
||||
'1697: str(1/3) == \"~333.33333333333333333333e-3\"');
|
||||
vrfy(str(2e8) == "200e6", \
|
||||
'1698: str(2e8) == \"200e6"');
|
||||
vrfy(str(200e6) == "200e6", \
|
||||
@@ -2075,8 +2075,8 @@ define test_mode()
|
||||
'1705: str(0xffffffff) == \"4294967295\"');
|
||||
vrfy(str(3e9) == "3000000000", \
|
||||
'1706: str(3e9) == \"3000000000\"');
|
||||
vrfy(str(1/3) == "~ 0", \
|
||||
'1707: str(1/3) == \"~ 0\"');
|
||||
vrfy(str(1/3) == "~0", \
|
||||
'1707: str(1/3) == \"~0\"');
|
||||
vrfy(str(2e8) == "200000000", \
|
||||
'1708: str(2e8) == \"200000000"');
|
||||
vrfy(str(200e6) == "200000000", \
|
||||
@@ -2096,8 +2096,8 @@ define test_mode()
|
||||
'1715: str(0xffffffff) == \"4294967295\"');
|
||||
vrfy(str(3e9) == "3000000000", \
|
||||
'1716: str(3e9) == \"3000000000\"');
|
||||
vrfy(str(1/3) == "~ 0.33333333333333333333", \
|
||||
'1717: str(1/3) == \"~ 0.33333333333333333333"');
|
||||
vrfy(str(1/3) == "~0.33333333333333333333", \
|
||||
'1717: str(1/3) == \"~0.33333333333333333333"');
|
||||
vrfy(str(2e8) == "200000000", \
|
||||
'1718: str(2e8) == \"200000000"');
|
||||
vrfy(str(200e6) == "200000000", \
|
||||
@@ -2151,8 +2151,8 @@ define test_mode()
|
||||
vrfy(base2() == -10, '1745: base2() == -10');
|
||||
vrfy(str(23209) == "23209 /* 23209 */",
|
||||
'1746: str(23209) == "23209 /* 23209 */"');
|
||||
vrfy(str(3/2) == "1.5 /* ~ 2 */",
|
||||
'1747: str(3/2) == "1.5 /* ~ 2 */"');
|
||||
vrfy(str(3/2) == "1.5 /* ~2 */",
|
||||
'1747: str(3/2) == "1.5 /* ~2 */"');
|
||||
|
||||
vrfy(base2(1000) == -10, '1748: base2(1000) == -1000');
|
||||
vrfy(base2() == 1000, '1749: base2() == 1000');
|
||||
|
2
config.c
2
config.c
@@ -213,7 +213,7 @@ CONFIG newstd = { /* new non-backward compatible configuration */
|
||||
POW_ALG2, /* size of modulus to use REDC for powers */
|
||||
REDC_ALG2, /* size of modulus to use REDC algorithm 2 */
|
||||
TRUE, /* OK to print a tilde on approximations */
|
||||
TRUE, /* OK to print a space after tilde on approximations */
|
||||
FALSE, /* OK to print a space after tilde on approximations */
|
||||
TRUE, /* OK to print tab before numeric values */
|
||||
0, /* quomod() default rounding mode */
|
||||
2, /* quotient // default rounding mode */
|
||||
|
@@ -135,7 +135,7 @@ DESCRIPTION
|
||||
config("display", 50); 50 digits of output
|
||||
epsilon(epsilon() / 8); 3 bits more accuracy
|
||||
config("tilde", 0) disable roundoff tilde printing
|
||||
config("tilde_space", 0) disable printing space after roundoff tilde
|
||||
config("tilde_space", 1) enable printing space after roundoff tilde
|
||||
config("tab", "off") disable leading tab printing
|
||||
|
||||
=-=
|
||||
@@ -382,7 +382,7 @@ DESCRIPTION
|
||||
printed after leading tilde ('~'). See config("tilde") above.
|
||||
If config("tilde") is false, then config("tilde_space") has no effect.
|
||||
|
||||
The initial "tilde_space" value is 1.
|
||||
The initial "tilde_space" value is 0.
|
||||
|
||||
=-=
|
||||
|
||||
@@ -924,6 +924,7 @@ EXAMPLE
|
||||
pow2 40
|
||||
redc2 50
|
||||
tilde 1
|
||||
tilde_space 0
|
||||
tab 1
|
||||
quomod 0
|
||||
quo 2
|
||||
|
Reference in New Issue
Block a user