GrayJack / coreutils

Core utils re-implementation for UNIX/UNIX-like systems written in Rust
Mozilla Public License 2.0
106 stars 40 forks source link

Seq: Missing last number on some cases #133

Closed GrayJack closed 2 years ago

GrayJack commented 3 years ago

Describe the bug Sometimes the seq utils don't output the last number that should be printed

To Reproduce Steps to reproduce the behavior:

  1. Run command with 0.000000001 0.0000000001 0.000000002 as parameters
  2. Command will output
0.0000000010
0.0000000011
0.0000000012
0.0000000013
0.0000000014
0.0000000015
0.0000000016
0.0000000017
0.0000000018
0.0000000019

Expected behavior Expected this output:

0.0000000010
0.0000000011
0.0000000012
0.0000000013
0.0000000014
0.0000000015
0.0000000016
0.0000000017
0.0000000018
0.0000000019
0.0000000020

Screenshots

image

Desktop (please complete the following information):

Additional context I only found this this case until now, but there is probably more cases

GrayJack commented 3 years ago

I found another more simple example:

seq 1 should output:

1

But outputs nothing

Edit: Looks like this issue is unrelated to the first described in the OP. this one is related to the valid_range being incorrect in the comparison between first and last

gahag commented 2 years ago

Can I work on this?

GrayJack commented 2 years ago

Sure thing @gahag! Have fun!