mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-14 05:31:14 -03:00
Default math scale to 6
This changes the behavior of builtin math to floating point by default. If the result of a computation is an integer, then it will be printed as an integer; otherwise it will be printed as a floating point decimal with up to 'scale' digits past the decimal point (default is 6, matching printf). Trailing zeros are trimmed. Values are rounded following printf semantics. Fixes #4478
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
####################
|
||||
# Validate basic expressions
|
||||
|
||||
####################
|
||||
# Validate some integral computations
|
||||
|
||||
####################
|
||||
# Validate how variables in an expression are handled
|
||||
|
||||
@@ -24,7 +27,7 @@ math: Error: Too many arguments
|
||||
^
|
||||
math: Expected at least 1 args, got only 0
|
||||
math: Expected at least 1 args, got only 0
|
||||
math: Error: Result is too large
|
||||
'2^650'
|
||||
math: Error: Result is infinite
|
||||
'2^999999'
|
||||
math: Error: Result is infinite
|
||||
'1 / 0'
|
||||
|
||||
Reference in New Issue
Block a user