Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seq: Output mismatch #6244

Open
Carbrex opened this issue Apr 16, 2024 · 2 comments
Open

seq: Output mismatch #6244

Carbrex opened this issue Apr 16, 2024 · 2 comments
Labels

Comments

@Carbrex
Copy link
Contributor

Carbrex commented Apr 16, 2024

$ cargo run seq 11e4931 11e4931
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s
     Running `target/debug/coreutils seq 11e4931 11e4931`
1100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
                                                                                                                                                                                   
$ seq 11e4931 11e4931
1099999999999999999974373107528241817659030869279043407734988001817024145106513112504247507989334878520248308281361039478032934883265306874247558219180296632615879769284426144446587301862925949044860103916345584575444940764072805023841127038694056136469796496577126541639538344365510095288710750981114492840403606011035722140950388865380426626956598546884662554156676899849274474003946737153202663113471019038507440355784997612447212190315662150842498356408074864010786635463165434158504462993091203108212159354301043245621277048030590981217752749212401923243127138342167748918430168950395586853357811402450292366170936077374287304280516496791243181744660062034825766801562331288150173113824584687813457202545074014431803319775315998574294061353416922646887741547820181608294728217534644103487399058533712092272305657732870431777406038928081305932744454766811852554655135914113871013315952423872114812576001290757699422940111221911945045555478113741593424829620020501745005161710852074978186012721939150513407866391014807697433774795954470026204995541086095733716024007432033404098852964387711906037511284559079635511511105265001649140398250845901004463286876433863964550221008676952276372763575067911963853973001567055756406569343128045403641205087980394365831369003383371685227603278316511752728825492551800986973888739380062196017445702056808445069966439845998936831463863177685365729564195287455361289677323687699873017110388717240797343316362732376481099624642042706786493959231517121398104419805714616715338680064974161422455804452567918920783640928588852013556050411583586757800270730283623088608996390812328255730910963083908032153603402103429802759514853593616153177067415500911713676922818119941758485502483713233836391339711841574287048214054398466058177648133951583659697856319367061612039944071671309477097363997509664406124665760289811187313097505600091492012780926469541380190748595297191682855137672939243900595892243809281653980678128535594541228440218634574770280704029980829588473167907433901747603664817549052020034363401122401934497142344372734618140572998330462995589527034982774919647972676484630128249232151111400418665059666503407412833853472426302097183776179610563338678157970778598436154852230047505079011474601450756518383098667900525033393730130873831407982398320863044521090953981107647680374498820504991155090311321944715075464093659603368699803397944284348470932230600497140776992039106460467277241357274444180967598387038056950513122745966308365514701933261279467260780160047872244699873110020313983169069446477846410770223000745472326974222305733387182924217259845948288427247030039382730488672890229875724957711454218804526205902529773029920794664316040495109529187373742219119822413974416337644618016902599598961368374895207391065016376787494616448057680729910798524806625099187066004462348989545247911652754375344583008535499532314813905020948248399115016943815715937994396941618435619169772385095396152416767195742049851747613446789499374318798671625381003617099318979921187323092570719108388936497413021570787532233753573732786708918585920746076107959919806474257304522391293937223772917858124175606129639031362747570161480150988788136235047002696138807315834676967498996056893633045100327055704032355749831583184677746838894850303565926247689146391879788439427269920324541554278141768823388006416617704470227965980425854679637276674238801946369896560455431159381910870233417834630593573883650136801998237960628020208247398481757468084566811835562055730279594121590811427373679641364043894097024788364847476979150654114561895755972439261022946239838345042369327640360307656142990885171448040586898198259723915086866804741833530114682089637546435457028154781181140931264907183459409078936729981544306081683010025321003041561883391470801186929063790223066325097692289553470222652062743716817355209725137427212444146559934968597141351682488626743327756829921471593990068872438225701901480173844607644558335922716519091818910648440929906650467666042330589650648201165134007539549842213154851674975025009949919518589140278940864888841740301067579841024563714682594585397073634656151707861040438536974108573443444281454191384584475697323062320067494855247657937783341904958252264900431607261250517735640918806139627134190829662969929928161163150996697459754147389369654546789346295061279066556987634926829726090875108170773496087213988428078725430074999430133270176603727855456303366522730112671767574399401456844648538462547659531008270166403919064525301187429965384383165284377279321704286099496402949518133649750949806158890635637969041636190902934947020628579214382009278904086610444871161338666575623527742889622596223558611437936647589192801663915111889094971481486408327912032020150988471330536026172285448434458991524947597084554968263341074076517000345409674031798358143745760733861343415397393159190284273438760077636163984763308746185933756214688892548733454529957267178522323242088136704

I think this can only be fixed by seq using float-128
Related #6235 #6182

@BenWiederhake
Copy link
Collaborator

In some sense, our result is "more correct" though. Where do we draw the line between "GNU compatibility" and "correctness"?

@maxer137
Copy link
Contributor

I had some discussion with some friends about this. I would hope it's not the case, but I can image some people checking the output of seq to see if a number is a proper float. If they do, then I worry about their scripts in general.
But it would be solvable with an optional flag. For example, adding a --bigdecimal for "more correct" output.
Otherwise, it would use floats with all the floating-point errors left in, thus being GNU compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants