mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-21 02:54:17 +08:00
builtin-math: Use normal C trunc
uClibc-ng does not expose C++11 math functions to the std namespace, breaking compilation. This is fine as the argument type is double. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
80a4898e75
commit
3b0f642de9
|
@ -163,7 +163,7 @@ static wcstring format_double(double v, const math_cmd_opts_t &opts) {
|
|||
// As a special-case, a scale of 0 means to truncate to an integer
|
||||
// instead of rounding.
|
||||
if (opts.scale == 0) {
|
||||
v = std::trunc(v);
|
||||
v = trunc(v);
|
||||
return format_string(L"%.*f", opts.scale, v);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user