nushell/crates/nu-command/src
Ryan Devenney 644164fab3
math floor and ceil round to int rather than float #8258 (#8269)
# Description

#8258 

Math floor and ceil return int types rather than floats.

# User-Facing Changes

Before:
```
/home/rdevenney/projects/open_source/nushell〉[(3.14 | math ceil | describe), 
(3.14 | math floor | describe), 
(3 | math ceil | describe), 
(3 | math floor | describe)]
╭───┬───────╮
│ 0 │ float │
│ 1 │ float │
│ 2 │ int   │
│ 3 │ int   │
╰───┴───────╯

```

After:
```
/home/rdevenney/projects/open_source/nushell〉[(3.14 | math ceil | describe), 
(3.14 | math floor | describe), 
(3 | math ceil | describe), 
(3 | math floor | describe)]
╭───┬─────╮
│ 0 │ int │
│ 1 │ int │
│ 2 │ int │
│ 3 │ int │
╰───┴─────╯

```

# Tests + Formatting

Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass

# After Submitting

If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
2023-02-28 21:28:16 -08:00
..
bits Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
bytes special-case ExternalStream in bytes starts-with (#8203) 2023-02-26 15:17:44 +01:00
charting Use variable names directly in the format strings (#7906) 2023-01-29 19:37:54 -06:00
conversions Fix one error message in into string (#8163) 2023-02-22 09:05:19 +00:00
database Use variable names directly in the format strings (#7906) 2023-01-29 19:37:54 -06:00
dataframe Cratification: Break out nu_cmd_lang into a separate crate (#8181) 2023-02-24 09:54:42 -06:00
date remove unnecessary rows in into datetime --list (#8243) 2023-02-27 11:21:52 +01:00
debug move ast command to the debug group (#8077) 2023-02-14 18:47:34 +00:00
deprecated Re-implement aliases (#8123) 2023-02-27 20:44:05 +13:00
env allow for arguments in EDITOR and VISUAL env vars (#8105) 2023-02-26 06:56:38 -06:00
experimental relocate debug commands (#8071) 2023-02-13 16:39:07 +00:00
filesystem Ctrl+c interruption - cp command (#8219) 2023-02-26 12:18:20 -08:00
filters Error out when Select gets same row (#8200) 2023-02-26 18:14:15 -08:00
formats Revert range expansion for to nuon (#8210) 2023-02-25 18:29:30 +01:00
generators Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
hash move hash md5 and hash sha256 commands to the hash category (#8196) 2023-02-24 11:53:25 -06:00
math math floor and ceil round to int rather than float #8258 (#8269) 2023-02-28 21:28:16 -08:00
misc Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
network Fix insecure + max-time arguments for HTTP commands. (#8266) 2023-02-28 14:33:28 -06:00
path Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
platform fix ansi example so it is tested (#8192) 2023-02-24 11:52:51 -06:00
random Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
shells Add more input/output type annotations (#7532) 2022-12-21 20:20:46 +01:00
strings Simplify str trim command (#8205) 2023-02-26 12:23:30 -08:00
system relocate debug commands (#8071) 2023-02-13 16:39:07 +00:00
viewers pipe binary data to external commands (#8058) 2023-02-24 21:39:52 +01:00
default_context.rs Re-implement aliases (#8123) 2023-02-27 20:44:05 +13:00
example_test.rs cratification: Example support (#8231) 2023-02-27 13:58:56 -08:00
input_handler.rs Standardise the use of ShellError::UnsupportedInput and ShellError::TypeMismatch and add spans to every instance of the former (#7217) 2022-12-23 01:48:53 -05:00
lib.rs Cratification: Break out nu_cmd_lang into a separate crate (#8181) 2023-02-24 09:54:42 -06:00
progress_bar.rs cp progress bar implementation (#8012) 2023-02-22 11:57:38 -08:00
sort_utils.rs Reduce again the number of match calls (#7815) 2023-01-24 12:23:42 +01:00