summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/math.c15
-rw-r--r--Src/options.c1
-rw-r--r--Src/zsh.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/Src/math.c b/Src/math.c
index e90d6a59a..f8a4eefeb 100644
--- a/Src/math.c
+++ b/Src/math.c
@@ -456,6 +456,11 @@ lexconstant(void)
yyval.u.l = zstrtol_underscore(ptr, &ptr, 0, 1);
/* Should we set lastbase here? */
lastbase = 16;
+ if (isset(FORCEFLOAT))
+ {
+ yyval.type = MN_FLOAT;
+ yyval.u.d = (double)yyval.u.l;
+ }
return NUM;
}
else if (isset(OCTALZEROES))
@@ -475,6 +480,11 @@ lexconstant(void)
{
yyval.u.l = zstrtol_underscore(ptr, &ptr, 0, 1);
lastbase = 8;
+ if (isset(FORCEFLOAT))
+ {
+ yyval.type = MN_FLOAT;
+ yyval.u.d = (double)yyval.u.l;
+ }
return NUM;
}
nptr = ptr2;
@@ -537,6 +547,11 @@ lexconstant(void)
lastbase = yyval.u.l;
yyval.u.l = zstrtol_underscore(ptr, &ptr, lastbase, 1);
}
+ if (isset(FORCEFLOAT))
+ {
+ yyval.type = MN_FLOAT;
+ yyval.u.d = (double)yyval.u.l;
+ }
}
return NUM;
}
diff --git a/Src/options.c b/Src/options.c
index b36bd9944..480fccd57 100644
--- a/Src/options.c
+++ b/Src/options.c
@@ -131,6 +131,7 @@ static struct optname optns[] = {
{{NULL, "extendedhistory", OPT_CSH}, EXTENDEDHISTORY},
{{NULL, "evallineno", OPT_EMULATE|OPT_ZSH}, EVALLINENO},
{{NULL, "flowcontrol", OPT_ALL}, FLOWCONTROL},
+{{NULL, "forcefloat", 0}, FORCEFLOAT},
{{NULL, "functionargzero", OPT_EMULATE|OPT_NONBOURNE},FUNCTIONARGZERO},
{{NULL, "glob", OPT_EMULATE|OPT_ALL}, GLOBOPT},
{{NULL, "globalexport", OPT_EMULATE|OPT_ZSH}, GLOBALEXPORT},
diff --git a/Src/zsh.h b/Src/zsh.h
index 207ef1836..f247563d4 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1988,6 +1988,7 @@ enum {
EXTENDEDHISTORY,
EVALLINENO,
FLOWCONTROL,
+ FORCEFLOAT,
FUNCTIONARGZERO,
GLOBOPT,
GLOBALEXPORT,