about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2013-03-05 20:06:59 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2013-03-05 20:06:59 +0000
commit26694406f22f0fe37d0b751066200bf0cfdec165 (patch)
treed7dc12babd4c9f28cd1588a3f94f8cedc76f594b /Functions
parent3def943d046ad03540dd188ab52c0eacaa021149 (diff)
downloadzsh-26694406f22f0fe37d0b751066200bf0cfdec165.tar.gz
zsh-26694406f22f0fe37d0b751066200bf0cfdec165.tar.xz
zsh-26694406f22f0fe37d0b751066200bf0cfdec165.zip
users/17666: zcalc -f sets FORCE_FLOAT
Diffstat (limited to 'Functions')
-rw-r--r--Functions/Misc/zcalc5
1 files changed, 4 insertions, 1 deletions
diff --git a/Functions/Misc/zcalc b/Functions/Misc/zcalc
index 2d0cf5d40..3d44f20db 100644
--- a/Functions/Misc/zcalc
+++ b/Functions/Misc/zcalc
@@ -114,7 +114,7 @@ float PI E
 (( PI = 4 * atan(1), E = exp(1) ))
 
 # Process command line
-while [[ -n $1 && $1 = -(|[#-]*) ]]; do
+while [[ -n $1 && $1 = -(|[#-]*|f) ]]; do
   optlist=${1[2,-1]}
   shift
   [[ $optlist = (|-) ]] && break
@@ -139,6 +139,9 @@ while [[ -n $1 && $1 = -(|[#-]*) ]]; do
 	    fi
             defbase="[#${arg}]"
 	    ;;
+	(f) # Force floating point operation
+	    setopt forcefloat
+	    ;;
     esac
   done
 done