mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Add config("fraction_space") to control spaces around printing fractions
Added config("tilde_space", boolean) to help/config, along with a few few minor text improvements. Updated cal/regress to test config("tilde_space"). Added config("fraction_space", boolean). The "fraction_space" controls whether or not a space (' ') is printed before and after fractions. By default, config("fraction_space") is false. For example, with the default, config("fraction_space", 0): ; base(1/3), ; 1/7 1/7 With config("fraction_space", 1): ; base(1/3), ; 1/7 1 / 7 NOTE: Use of config("fraction_space", 1) can break printing and scanning of fractional values via "%r". NOTE: Use of config("fraction_space", 1) can break printing and scanning of complex values via "%c". Added config("fraction_space", boolean) to help/config, along with a few few minor text improvements. Updated cal/regress to test config("tilde_space").
This commit is contained in:
2
config.h
2
config.h
@@ -95,6 +95,7 @@
|
||||
#define CONFIG_DUPVAR_WARN 45
|
||||
#define CONFIG_HZ 46
|
||||
#define CONFIG_TILDE_SPACE 47
|
||||
#define CONFIG_FRACTION_SPACE 48
|
||||
|
||||
|
||||
/*
|
||||
@@ -167,6 +168,7 @@ 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