mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Add config("complex_space") to control spaces around + or - in complex values
Added config("fraction_space", boolean) to help/config, along with a few few minor text improvements. Updated cal/regress to test config("tilde_space"). Added config("complex_space", boolean). The "complex_space" controls whether or not a space (' ') is printed before and after the + or - in complex values. By default, config("complex_space") is false. For example, with the default, config("complex_space", 0): ; asin(2) 1.57079632679489661923-1.31695789692481670863i With config("complex_space", 1): ; asin(2) 1.57079632679489661923 - 1.31695789692481670863i NOTE: Use of config("complex_space", 1) can break printing and scanning of fractional values via "%r". NOTE: Use of config("complex_space", 1) can break printing and scanning of complex values via "%c". Added config("complex_space", boolean) to help/config, along with a few few minor text improvements. Updated cal/regress to test config("complex_space").
This commit is contained in:
6
config.h
6
config.h
@@ -96,6 +96,7 @@
|
||||
#define CONFIG_HZ 46
|
||||
#define CONFIG_TILDE_SPACE 47
|
||||
#define CONFIG_FRACTION_SPACE 48
|
||||
#define CONFIG_COMPLEX_SPACE 49
|
||||
|
||||
|
||||
/*
|
||||
@@ -125,7 +126,7 @@ struct config {
|
||||
int outmode2; /* current secondary output mode */
|
||||
LEN outdigits; /* current output digits for float or exp */
|
||||
NUMBER *epsilon; /* default error for real functions */
|
||||
long epsilonprec; /* epsilon binary precision (tied to epsilon) */
|
||||
long epsilonprec; /* epsilon binary precision (tied to epsilon) */
|
||||
FLAG traceflags; /* tracing flags */
|
||||
LEN maxprint; /* number of elements to print */
|
||||
LEN mul2; /* size of number to use multiply algorithm 2 */
|
||||
@@ -134,6 +135,8 @@ struct config {
|
||||
LEN redc2; /* size of modulus to use REDC algorithm 2 */
|
||||
BOOL tilde_ok; /* OK to print a tilde on approximations */
|
||||
BOOL tilde_space; /* print space after tilde on approximations */
|
||||
BOOL fraction_space; /* TRUE => print spaces around / in fractions */
|
||||
BOOL complex_space; /* TRUE => print spaces around + or - in complex values */
|
||||
BOOL tab_ok; /* OK to print tab before numeric values */
|
||||
LEN quomod; /* quomod() default rounding mode */
|
||||
LEN quo; /* quotient // default rounding mode */
|
||||
@@ -168,7 +171,6 @@ struct config {
|
||||
int baseb; /* base for calculations */
|
||||
BOOL redecl_warn; /* TRUE => warn of redeclaring variables */
|
||||
BOOL dupvar_warn; /* TRUE => warn of var name collisions */
|
||||
BOOL fraction_space; /* TRUE => print spaces around / in fractions */
|
||||
};
|
||||
typedef struct config CONFIG;
|
||||
|
||||
|
Reference in New Issue
Block a user