Description: Round Down is Rounding Up LibreOffice Calc 7.5.2.2 Formula: =ROUNDDOWN(726498.789999828,2) Actual Result: 726498.79 Expected Result: 726498.78 Steps to Reproduce: 1.Formula: =ROUNDDOWN(726498.789999828,2) 2. 3. Actual Results: 726498.79 Expected Results: 726498.78 Reproducible: Always User Profile Reset: No Additional Info:
More similar results: =ROUNDDOWN(0,732408599999637;7) =ROUNDDOWN(0,424022899999582;7) =ROUNDDOWN(0,61383929999973;7) =ROUNDDOWN(0,913013599999986;7) =ROUNDDOWN(0,534869139999963;8) =ROUNDDOWN(0,339286659999962;8) =ROUNDDOWN(0,388946389999921;8) =ROUNDDOWN(0,128792969999833;8) =ROUNDDOWN(0,918072469999812;8) =ROUNDDOWN(0,452958149999671;8) =ROUNDDOWN(0,74610831999999;8) =ROUNDDOWN(0,375753719999617;8) =ROUNDDOWN(0,316556369999977;8) =ROUNDDOWN(0,24072200999973;8) =ROUNDDOWN(0,787409559999966;8) =ROUNDDOWN(0,854018219999626;8) =ROUNDDOWN(0,718439559999691;8) =ROUNDDOWN(0,920933239999793;8) =ROUNDDOWN(0,945823809999685;8) =ROUNDDOWN(0,493242949999628;8) =ROUNDDOWN(0,920726239999766;8) =ROUNDDOWN(0,885403559999701;8) =ROUNDDOWN(0,209399159999661;8) =ROUNDDOWN(0,274582969999668;8) =ROUNDDOWN(0,800619829999956;8) =ROUNDDOWN(0,93518275999984;8) =ROUNDDOWN(0,44901621999988;8) =ROUNDDOWN(0,717317019999877;8) =ROUNDDOWN(0,242141219999791;8) =ROUNDDOWN(0,963270409999931;8) =ROUNDDOWN(0,351773279999584;8) =ROUNDDOWN(0,103325639999762;8) =ROUNDDOWN(0,715379469999621;8) =ROUNDDOWN(0,679568659999601;8) =ROUNDDOWN(0,48239324999972;8) =ROUNDDOWN(0,230383469999918;8) =ROUNDDOWN(0,570156859999557;8) =ROUNDDOWN(0,382890769999536;8) =ROUNDDOWN(0,486522542999658;9) =ROUNDDOWN(0,207706980999787;9) =ROUNDDOWN(0,264352682999915;9) =ROUNDDOWN(0,380741996999509;9) =ROUNDDOWN(0,987005533999807;9) =ROUNDDOWN(0,728416176999864;9) =ROUNDDOWN(0,102273951999846;9) =ROUNDDOWN(0,866330952999712;9) =ROUNDDOWN(0,818565364999995;9) =ROUNDDOWN(0,270368694999564;9) =ROUNDDOWN(0,747412690999525;9) =ROUNDDOWN(0,255219123999821;9) =ROUNDDOWN(0,494924880999531;9) =ROUNDDOWN(0,919802021999832;9) =ROUNDDOWN(0,458606254999667;9) =ROUNDDOWN(0,414458845999935;9) =ROUNDDOWN(0,585211222999878;9) =ROUNDDOWN(0,96373742099995;9) =ROUNDDOWN(0,319999697999666;9) =ROUNDDOWN(0,760071150999872;9) =ROUNDDOWN(0,323206763999731;9) =ROUNDDOWN(0,933886507999978;9) =ROUNDDOWN(0,270836215999639;9) =ROUNDDOWN(0,470756362999743;9) =ROUNDDOWN(0,919504421999606;9) =ROUNDDOWN(0,834286630999855;9) =ROUNDDOWN(0,146481180999981;9) =ROUNDDOWN(0,318729495999959;9) =ROUNDDOWN(0,527761614999867;9) =ROUNDDOWN(0,754079798999649;9) =ROUNDDOWN(0,635067753999862;9) =ROUNDDOWN(0,492298006999591;9) =ROUNDDOWN(0,380842880999641;9) =ROUNDDOWN(0,814190405999601;9) =ROUNDDOWN(0,306848643999746;9) =ROUNDDOWN(0,520879093999653;9) =ROUNDDOWN(0,641185873999863;9) =ROUNDDOWN(0,633825404999869;9) =ROUNDDOWN(0,362433242999796;9) =ROUNDDOWN(0,841368848999608;9) =ROUNDDOWN(0,168497187999897;9) =ROUNDDOWN(0,646407398999634;9) =ROUNDDOWN(0,957367844999686;9) =ROUNDDOWN(0,219559914999827;9) =ROUNDDOWN(0,23745616899971;9) =ROUNDDOWN(0,270299840999961;9) =ROUNDDOWN(0,688906770999809;9) =ROUNDDOWN(0,536540607999855;9) =ROUNDDOWN(0,991720963999978;9) =ROUNDDOWN(0,106985701999908;9) =ROUNDDOWN(0,539153372999697;9) =ROUNDDOWN(0,201888337999978;9) =ROUNDDOWN(0,705567737999905;9) =ROUNDDOWN(0,200973874999753;9) =ROUNDDOWN(0,777503324999846;9) =ROUNDDOWN(0,697391945999549;9) =ROUNDDOWN(0,474274081999615;9) =ROUNDDOWN(0,694767363999515;9) =ROUNDDOWN(0,365817825999917;9) =ROUNDDOWN(0,246802110999931;9) =ROUNDDOWN(0,843663117999881;9) =ROUNDDOWN(0,336486102999574;9) =ROUNDDOWN(0,768059536999587;9) =ROUNDDOWN(0,599121260999652;9) =ROUNDDOWN(0,537480061999522;9) =ROUNDDOWN(0,907940152999524;9) =ROUNDDOWN(0,811883944999585;9) =ROUNDDOWN(0,938522686999861;9) =ROUNDDOWN(0,80317491199955;9) =ROUNDDOWN(0,685191610999535;9) =ROUNDDOWN(0,541421655999587;9) =ROUNDDOWN(0,823912276999719;9) =ROUNDDOWN(0,393509522999792;9) =ROUNDDOWN(0,735042354999685;9) =ROUNDDOWN(0,814341232999972;9) =ROUNDDOWN(0,842726873999506;9) =ROUNDDOWN(0,49194282599999;9) =ROUNDDOWN(0,299548945999996;9) =ROUNDDOWN(0,80646619599995;9) =ROUNDDOWN(0,797380755999505;9) =ROUNDDOWN(0,779618215999621;9) =ROUNDDOWN(0,418446598999682;9) =ROUNDDOWN(0,913904134999766;9) =ROUNDDOWN(0,323274472999604;9) =ROUNDDOWN(0,314597528999558;9) =ROUNDDOWN(0,419348068999968;9) =ROUNDDOWN(0,104210144999663;9) =ROUNDDOWN(0,229351741999903;9) =ROUNDDOWN(0,347384450999664;9) =ROUNDDOWN(0,55301119399999;9) =ROUNDDOWN(0,453098723999866;9) =ROUNDDOWN(0,216225521999548;9) =ROUNDDOWN(0,802037942999632;9) =ROUNDDOWN(0,358380620999819;9) =ROUNDDOWN(0,647990282999567;9) =ROUNDDOWN(0,50955055899986;9) =ROUNDDOWN(0,298792970999831;9) =ROUNDDOWN(0,652273068999963;9) =ROUNDDOWN(0,815972423999912;9) =ROUNDDOWN(0,352051391999992;9) =ROUNDDOWN(0,630840460999538;9) =ROUNDDOWN(0,665560966999951;9) =ROUNDDOWN(0,273503630999921;9) =ROUNDDOWN(0,0234904789999796;9) =ROUNDDOWN(0,914041960999535;9) =ROUNDDOWN(0,311047591999761;9) =ROUNDDOWN(0,155929991999592;9) =ROUNDDOWN(0,256313650999617;9) =ROUNDDOWN(0,566019125999812;9) =ROUNDDOWN(0,380518914999971;9) =ROUNDDOWN(0,157886176999911;9) =ROUNDDOWN(0,837643923999616;9) =ROUNDDOWN(0,162028665999619;9) =ROUNDDOWN(0,267603247999877;9) =ROUNDDOWN(0,562221234999578;9) =ROUNDDOWN(0,613851660999973;9) =ROUNDDOWN(0,415543833999622;9) =ROUNDDOWN(0,449150605999686;9) =ROUNDDOWN(0,705988861999869;9) =ROUNDDOWN(0,494352921999755;9) =ROUNDDOWN(0,468914162999916;9) =ROUNDDOWN(0,915655238999614;9) =ROUNDDOWN(0,314214020999743;9) =ROUNDDOWN(0,851231421999576;9) =ROUNDDOWN(0,715917804999938;9) =ROUNDDOWN(0,253959414999952;9) =ROUNDDOWN(0,818206140999719;9) =ROUNDDOWN(0,126015042999546;9) =ROUNDDOWN(0,599615611999739;9) =ROUNDDOWN(0,829059515999875;9) =ROUNDDOWN(0,240494292999818;9) =ROUNDDOWN(0,492360878999517;9) =ROUNDDOWN(0,117330948999547;9) =ROUNDDOWN(0,819547438999526;9) =ROUNDDOWN(0,415810621999755;9) =ROUNDDOWN(0,979671875999771;9) =ROUNDDOWN(0,366310235999664;9) =ROUNDDOWN(0,876752273999801;9) =ROUNDDOWN(0,269684057999982;9) =ROUNDDOWN(0,931316900999593;9) =ROUNDDOWN(0,351721518999729;9) =ROUNDDOWN(0,89982804799987;9) =ROUNDDOWN(0,114632008999867;9) =ROUNDDOWN(0,370346278999819;9) =ROUNDDOWN(0,70001534899979;9) =ROUNDDOWN(0,367270096999701;9) =ROUNDDOWN(0,220780682999994;9) =ROUNDDOWN(0,379746573999644;9) =ROUNDDOWN(0,841968963999588;9) =ROUNDDOWN(0,413512593999931;9) =ROUNDDOWN(0,688540612999794;9) =ROUNDDOWN(0,658848380999795;9) =ROUNDDOWN(0,110573497999661;9) =ROUNDDOWN(0,724589624999582;9) =ROUNDDOWN(0,283535595999794;9) =ROUNDDOWN(0,860571264999691;9) =ROUNDDOWN(0,782497197999656;9) =ROUNDDOWN(0,776184522999624;9) =ROUNDDOWN(0,427209512999759;9) =ROUNDDOWN(0,426175835999928;9) =ROUNDDOWN(0,638302665999719;9) =ROUNDDOWN(0,239386426999598;9) =ROUNDDOWN(0,763411297999865;9) =ROUNDDOWN(0,61508680899983;9) =ROUNDDOWN(0,723929081999691;9) =ROUNDDOWN(0,979933397999868;9) =ROUNDDOWN(0,744068686999528;9) =ROUNDDOWN(0,437241330999531;9) =ROUNDDOWN(0,190841354999902;9) =ROUNDDOWN(0,155951728999517;9) =ROUNDDOWN(0,169812938999548;9) =ROUNDDOWN(0,724812132999865;9) =ROUNDDOWN(0,103482067999712;9) =ROUNDDOWN(0,151042670999629;9) =ROUNDDOWN(0,957546743999949;9) =ROUNDDOWN(0,453924072999891;9) =ROUNDDOWN(0,165099015999647;9) =ROUNDDOWN(0,18554255899979;9) =ROUNDDOWN(0,707351027999523;9) =ROUNDDOWN(0,669823617999599;9) =ROUNDDOWN(0,98635963199978;9) =ROUNDDOWN(0,986929320999809;9) =ROUNDDOWN(0,823360992999712;9) =ROUNDDOWN(0,501002676999642;9) =ROUNDDOWN(0,114736177999586;9) =ROUNDDOWN(0,144973414999578;9) =ROUNDDOWN(0,21345649799984;9) =ROUNDDOWN(0,947616965999995;9) =ROUNDDOWN(0,207172641999724;9) =ROUNDDOWN(0,864825057999533;9) =ROUNDDOWN(0,753536746999958;9) =ROUNDDOWN(0,660603615999505;9) =ROUNDDOWN(0,41340928899954;9) =ROUNDDOWN(0,958529118999989;9) =ROUNDDOWN(0,881207450999609;9) =ROUNDDOWN(0,910782602999844;9) =ROUNDDOWN(0,721502923999759;9) =ROUNDDOWN(0,353538531999926;9) =ROUNDDOWN(0,177948828999615;9) =ROUNDDOWN(0,412594853999517;9) =ROUNDDOWN(0,776600408999756;9) =ROUNDDOWN(0,792227294999855;9) =ROUNDDOWN(0,284739491999722;9) =ROUNDDOWN(0,346908663999563;9) =ROUNDDOWN(0,77228706399994;9) =ROUNDDOWN(0,853566253999502;9) =ROUNDDOWN(0,737400191999863;9) =ROUNDDOWN(0,551310347999786;9) =ROUNDDOWN(0,246319088999522;9) =ROUNDDOWN(0,834462971999911;9) =ROUNDDOWN(0,486489383999929;9) =ROUNDDOWN(0,316338752999939;9) =ROUNDDOWN(0,91074588099989;9) =ROUNDDOWN(0,636679817999783;9) =ROUNDDOWN(0,73191238199962;9) =ROUNDDOWN(0,710816571999571;9) =ROUNDDOWN(0,132395616999603;9) =ROUNDDOWN(0,845180002999714;9) =ROUNDDOWN(0,342742964999617;9) =ROUNDDOWN(0,795543520999672;9) =ROUNDDOWN(0,888224377999927;9) =ROUNDDOWN(0,682101584999705;9) =ROUNDDOWN(0,860013211999742;9) =ROUNDDOWN(0,212455951999669;9) =ROUNDDOWN(0,736411424999737;9) =ROUNDDOWN(0,52975939499976;9) =ROUNDDOWN(0,7794628839997;9) =ROUNDDOWN(0,280943440999763;9) =ROUNDDOWN(0,829364305999693;9) =ROUNDDOWN(0,403840455999751;9) =ROUNDDOWN(0,735870666999563;9) =ROUNDDOWN(0,558818971999782;9) =ROUNDDOWN(0,519670071999791;9) =ROUNDDOWN(0,565129144999695;9) =ROUNDDOWN(0,259000705999852;9) =ROUNDDOWN(0,389342558999788;9) =ROUNDDOWN(0,464708655999897;9) =ROUNDDOWN(0,541921450999874;9) =ROUNDDOWN(0,183173624999925;9) =ROUNDDOWN(0,544569693999813;9) =ROUNDDOWN(0,651083768999733;9) =ROUNDDOWN(0,408014907999965;9) =ROUNDDOWN(0,369388221999839;9) =ROUNDDOWN(0,774836202999611;9) =ROUNDDOWN(0,537266854999624;9) =ROUNDDOWN(0,257628933999516;9) =ROUNDDOWN(0,124823722999803;9) =ROUNDDOWN(0,896361812999568;9) =ROUNDDOWN(0,559011708999874;9) =ROUNDDOWN(0,503266443999989;9) =ROUNDDOWN(0,349996826999977;9) =ROUNDDOWN(0,614050723999806;9) =ROUNDDOWN(0,575614041999562;9) =ROUNDDOWN(0,105302170999566;9) =ROUNDDOWN(0,63258641599999;9) =ROUNDDOWN(0,707251595999939;9) =ROUNDDOWN(0,847211805999788;9) =ROUNDDOWN(0,784850956999622;9) =ROUNDDOWN(0,363126163999584;9) =ROUNDDOWN(0,629569957999912;9) =ROUNDDOWN(0,270191951999885;9) =ROUNDDOWN(0,802371637999713;9) =ROUNDDOWN(0,945288871999718;9) =ROUNDDOWN(0,703774798999995;9) =ROUNDDOWN(0,455703264999968;9) =ROUNDDOWN(0,905641614999887;9) =ROUNDDOWN(0,646913953999962;9) =ROUNDDOWN(0,968227452999706;9) =ROUNDDOWN(0,109169715999563;9) =ROUNDDOWN(0,283729684999856;9) =ROUNDDOWN(0,678795042999727;9) =ROUNDDOWN(0,650014594999893;9) =ROUNDDOWN(0,8188268759996;9) =ROUNDDOWN(0,598626595999577;9) =ROUNDDOWN(0,209259338999844;9) =ROUNDDOWN(0,649631498999611;9) =ROUNDDOWN(0,750743908999967;9) =ROUNDDOWN(0,207865955999814;9) =ROUNDDOWN(0,823478187999795;9) =ROUNDDOWN(0,593648620999963;9) =ROUNDDOWN(0,572654422999572;9) =ROUNDDOWN(0,36804812299967;9) =ROUNDDOWN(0,479223171999658;9) =ROUNDDOWN(0,75479949399978;9) =ROUNDDOWN(0,8813246329999;9) =ROUNDDOWN(0,812521515999912;9) =ROUNDDOWN(0,757682180999727;9) =ROUNDDOWN(0,594705430999937;9) =ROUNDDOWN(0,467706274999835;9) =ROUNDDOWN(0,779740763999611;9) =ROUNDDOWN(0,198140407999854;9) =ROUNDDOWN(0,37396683899973;9) =ROUNDDOWN(0,125945272999546;9) =ROUNDDOWN(0,797549810999586;9) =ROUNDDOWN(0,778781554999906;9) =ROUNDDOWN(0,554177755999767;9) =ROUNDDOWN(0,733712055999669;9) =ROUNDDOWN(0,673925454999924;9) =ROUNDDOWN(0,899213628999646;9) =ROUNDDOWN(0,392691798999883;9) =ROUNDDOWN(0,662027932999544;9) =ROUNDDOWN(0,781599530999619;9) =ROUNDDOWN(0,571807965999676;9) =ROUNDDOWN(0,53726233699958;9) =ROUNDDOWN(0,576410680999529;9) =ROUNDDOWN(0,297006951999599;9) =ROUNDDOWN(0,642925438999777;9) =ROUNDDOWN(0,742926534999972;9) =ROUNDDOWN(0,969396040999948;9) =ROUNDDOWN(0,758472772999769;9) =ROUNDDOWN(0,599156112999857;9) =ROUNDDOWN(0,38509906099971;9) =ROUNDDOWN(0,82163566099953;9) =ROUNDDOWN(0,147804242999893;9) =ROUNDDOWN(0,696007436999501;9) =ROUNDDOWN(0,660287417999859;9) =ROUNDDOWN(0,458017192999862;9) =ROUNDDOWN(0,78673978899971;9) =ROUNDDOWN(0,700498542999559;9) =ROUNDDOWN(0,604251097999915;9) =ROUNDDOWN(0,986577866999963;9) =ROUNDDOWN(0,100118864999666;9) =ROUNDDOWN(0,150130763999951;9) =ROUNDDOWN(0,38197907299991;9) =ROUNDDOWN(0,286244104999986;9) =ROUNDDOWN(0,843870716999549;9) =ROUNDDOWN(0,246952678999571;9) =ROUNDDOWN(0,812874138999517;9) =ROUNDDOWN(0,837017692999982;9) =ROUNDDOWN(0,126623435999958;9) =ROUNDDOWN(0,533991535999533;9) =ROUNDDOWN(0,270108911999575;9) =ROUNDDOWN(0,644370213999746;9) =ROUNDDOWN(0,523472104999907;9) =ROUNDDOWN(0,771070737999547;9) =ROUNDDOWN(0,827065045999537;9) =ROUNDDOWN(0,875996491999825;9) =ROUNDDOWN(0,262874127999577;9) =ROUNDDOWN(0,75818361699997;9) =ROUNDDOWN(0,754247962999952;9) =ROUNDDOWN(0,350820147999604;9) =ROUNDDOWN(0,530821663999929;9) =ROUNDDOWN(0,932798092999745;9) =ROUNDDOWN(0,319696641999634;9) =ROUNDDOWN(0,475381534999602;9) =ROUNDDOWN(0,842856186999921;9) =ROUNDDOWN(0,237890501999608;9) =ROUNDDOWN(0,974837343999944;9) =ROUNDDOWN(0,733124294999831;9) =ROUNDDOWN(0,861982573999651;9) =ROUNDDOWN(0,684773632999816;9) =ROUNDDOWN(0,369812885999929;9) =ROUNDDOWN(0,204511395999903;9) =ROUNDDOWN(0,16204671599992;9) =ROUNDDOWN(0,727893632999547;9) =ROUNDDOWN(0,900544458999991;9) =ROUNDDOWN(0,933626006999833;9) =ROUNDDOWN(0,874513243999911;9) =ROUNDDOWN(0,55004178299964;9) =ROUNDDOWN(0,377991423999962;9) =ROUNDDOWN(0,301006715999572;9) =ROUNDDOWN(0,964348476999878;9) =ROUNDDOWN(0,279390197999764;9) =ROUNDDOWN(0,882188254999661;9) =ROUNDDOWN(0,573829158999653;9) =ROUNDDOWN(0,872427293999736;9) =ROUNDDOWN(0,669438855999702;9) =ROUNDDOWN(0,732627434999741;9) =ROUNDDOWN(0,372745606999621;9) =ROUNDDOWN(0,597979783999986;9) =ROUNDDOWN(0,108784001999548;9) =ROUNDDOWN(0,496049353999954;9) =ROUNDDOWN(0,657499816999859;9) =ROUNDDOWN(0,559773237999658;9) =ROUNDDOWN(0,435210121999789;9) =ROUNDDOWN(0,994021352999898;9) =ROUNDDOWN(0,945381980999754;9) =ROUNDDOWN(0,625795638999965;9) =ROUNDDOWN(0,356537541999861;9) =ROUNDDOWN(0,134888507999548;9) =ROUNDDOWN(0,577318263999717;9) =ROUNDDOWN(0,411614640999528;9) =ROUNDDOWN(0,965758495999545;9) =ROUNDDOWN(0,977041455999955;9) =ROUNDDOWN(0,965309718999699;9) =ROUNDDOWN(0,648823561999705;9) =ROUNDDOWN(0,313062091999689;9) =ROUNDDOWN(0,695517134999942;9) =ROUNDDOWN(0,894171512999616;9) =ROUNDDOWN(0,21510382499989;9) =ROUNDDOWN(0,0114060339999771;9) =ROUNDDOWN(0,153759768999958;9) =ROUNDDOWN(0,424727607999614;9) =ROUNDDOWN(0,883360273999835;9) =ROUNDDOWN(0,586886706999967;9) =ROUNDDOWN(0,950743978999659;9) =ROUNDDOWN(0,39127763699982;9) =ROUNDDOWN(0,362037671999679;9) =ROUNDDOWN(0,802589946999816;9) =ROUNDDOWN(0,444707520999939;9) =ROUNDDOWN(0,186937917999675;9) =ROUNDDOWN(0,296445418999799;9) =ROUNDDOWN(0,654881037999784;9) =ROUNDDOWN(0,237060665999838;9) =ROUNDDOWN(0,989748012999845;9) =ROUNDDOWN(0,581538118999819;9) =ROUNDDOWN(0,603161084999741;9) =ROUNDDOWN(0,42465925099959;9) =ROUNDDOWN(0,420246683999595;9) =ROUNDDOWN(0,974508461999907;9) =ROUNDDOWN(0,728060148999865;9) =ROUNDDOWN(0,817880986999513;9) =ROUNDDOWN(0,144935025999699;9) =ROUNDDOWN(0,274564006999991;9) =ROUNDDOWN(0,280380982999872;9) =ROUNDDOWN(0,326297308999543;9) =ROUNDDOWN(0,816285470999557;9) =ROUNDDOWN(0,937148362999922;9) =ROUNDDOWN(0,873141277999869;9) =ROUNDDOWN(0,435691518999646;9) =ROUNDDOWN(0,637744878999992;9) =ROUNDDOWN(0,768781672999952;9) =ROUNDDOWN(0,729125143999572;9) =ROUNDDOWN(0,132052058999511;9) =ROUNDDOWN(0,688277893999947;9) =ROUNDDOWN(0,130066726999637;9) =ROUNDDOWN(0,71488452599999;9) =ROUNDDOWN(0,849892375999926;9) Similar things may be found for other rounding functions. We can add a final corrections to the respective methods, checking if the end result is greater than the original, and fix it?
Hmm, this might be intentional: rtl_math_round uses rtl::math::approxFloor, to explicitly round the passed value to nearest, when the distance is *very close*. Likely this is to avoid users' surprise, when the really small deviation is caused by previous calculations inaccuracies. Likely there's a trade-off.
*** Bug 154797 has been marked as a duplicate of this bug. ***
Rounding a number to nth digit is exact. Not an approximation. Round Up: Increment nth digit. Truncate >nth digit. Round Down: Truncate >nth digit. Round Nearest: If nth+1 digit is 5 to 9, increment nth digit. Truncate >nth digit. Any calculator that cannot do this exactly and reliably is not fit for serious use. Ask a major financial institution if rounding pennies incorrectly is acceptable.
(In reply to NOYB from comment #4) Please don't claim things like that, when you don't understand it. There is *nothing* exact in floating-point calculations in Calc, just as well as in Excel. If that doesn't fit your task, then you need another tool. This issue could be a problem or not (I hope Eike would clarify), but knowing your tool is crucial, and claiming what it must is useless.
Oh but I do understand it. I never said floating point was exact. I said "rounding a number to nth digit is exact." And it is. The rules are very clear. Excel, even from a decade ago (MSO2K13P), correctly rounds all 466 cases you posted (and the example I posted as well). This is not a matter of floating point not being exact. Rather the method being employed to do the rounding to nth digit is flawed. Anything other than the exact result according to the rounding rules is a flaw. Within the precision limits of the underlying system e.g. 19 digits etc. All of the cases posted thus far are well within that. I agree... Knowing that LibreOffice Calc doesn't round correctly is crucial. Businesses and professionals don't want to lose credibility and be the laughing stock of their peers. Claiming what it must do is not useless. It is communicating expectation. Expecting a calculator to round correctly is very reasonable. Fundamental even. Been using LibreOffice Calc for a little while now and like it. Hope that bugs like this will not get dismissive treatment and ignored instead of being fixed. I think this is a major flaw. More significate relative to product market than the FDIV flaw in '94.
(In reply to NOYB from comment #6) > Oh but I do understand it. I doubt that. You probably don't know why all this not-straight-forward rounding is implemented. Just take a look at the example of bug 124286 =ROUNDDOWN(8.94-8;2) that for 8.94-8 with the floating point inaccuracy already produces 0.9399999999999995 which following the "rounding a number to nth digit is exact" would produce 0.93 instead of the expected 0.94, hence we try to account for inaccuracy which works for many but not all values and needs to be refined. > Within the > precision limits of the underlying system e.g. 19 digits etc. There is no 19 digits precision. IEEE 754 double has a decimal digits precision of 15 to 17.
You are talking about internal rounding of calculations. This issue is about the ROUNDDOWN function that is applied to a value per the formula given by the user. If the user want's it rounded down to 2 digits then 0.93 is the correct answer/result for a value of 0.9399999999999995. If the user want's it round up or to nearest 2 digits then 0.94 is the correct answer/result. The rounding functions need to work correctly. Thus producing and exact result of the respective rounding function. Which of these do you reject as not being correct? Round Up: Increment nth digit. Truncate >nth digit. Round Down: Truncate >nth digit. Round Nearest: If nth+1 digit is 5 to 9, increment nth digit. Truncate >nth digit. The point re: digits of precision is that whatever the underlying precision is, whether it be 6, 10, 15, 17, 19, etc. digits, the rounding functions should be accurate. The ROUNDDOWN function for certain is not. Function Wizard ROUNDDOWN( Number, Count ) Rounds a number down to a predefined accuracy. The ROUNDDOWN function does not reliably do what it claims. It is flawed. Period.
There is no decimal representation in binary floating point hence any decimal "nth digit" does not exist for values other than multiples of powers of two. Period. (In reply to NOYB from comment #8) > If the user want's it rounded down to 2 digits then 0.93 > is the correct answer/result for a value of 0.9399999999999995. It is not if that 0.9399999999999995 is a result of the calculation of 8.94-8 because the exact number 0.94 is not representable in binary floating point and the nearest value is 0.939999999999999946709294817992486059665679931640625 and the user expects a ROUNDDOWN(8.94-8;2) to be ROUNDDOWN(0.94;2) to equal 0.94 (which it never is). I don't say we can't have a better implementation, I just state the complexities.
You're building a flaw into the ROUNDDOWN function in order to accommodate truncated results of the upstream calculation. 8.94-8 is 0.94. Rounding that up, down or nearest is 0.94. Exactly. Not approximately. But providing the truncated result of 8.94-8 (0.9399999999999995) to the ROUNDDOWN function should result in 0.93. Which is the correct result of the ROUNDDOWN function for the given input. ROUNDDOWN(0.9399999999999995,2) should correctly result in 0.93. The flaw is upstream with the truncated result of 8.94-8 (0.9399999999999995) being used rather than providing the correct result of 0.94 to the ROUNDDOWN function. GIGO The above are considering 0.9399999999999995 is retained as truncated value rather than the correct value of 0.94. (long ago been corrected) Code the ROUNDDOWN function to do what it is supposed to do. "Rounds a number down to a predefined accuracy." Stop using it to correct incorrect upstream results.
(In reply to NOYB from comment #10) > truncated results of the upstream calculation. 8.94-8 is 0.94. Rounding > that up, down or nearest is 0.94. Exactly. Not approximately. (In reply to NOYB from comment #6) > Oh but I do understand it. I never said floating point was exact. Hmm... Did that person made self-contradicting statements, or have I misread? Does that person even tried to look up the exact representation and the exact *value* of "0.94" in IEEE 754 double precision? But well, I remember that erAck's "I fix bugs even for ..."
Apparently you are unable to distinguish between actual values and computer floating point calculated values. There is an exact result value of 8.94-8. It is 0.94. This is the value that Excel, Calc, Windows calculator, handheld calculators, etc. provide to the user. Why? Because it is the correct result. There is also an exact correct round down result of 8.94-8. It is 0.94. It is exact. If the calculation of 8.94-8 provides some other value than 0.94 to the user or subsequent calculation then it is in error and the result should be GIGO. Regardless of what computer floating point calculation is able to do. The tool (calculator) is to provide the user with the correct result. If it has to use additional means beyond the capabilities of floating point to do so. Counting it's fingers and toes so to speak. Then so be it. You all want to tout floating point not being exact as justification for providing incorrect results. Well guess what. Microsoft figured it out long long time ago. You're decades behind on something as fundamental as subtraction and rounding down. You're letting the tool (floating point) get in the way of providing correct results to the user.
(In reply to NOYB from comment #12) Please ask Excel to count `=ROUNDUP(0.01-(10.01-10);2)`. You just imagine that Excel knows "how to count properly", and provides you "the correct result". It just does mistakes in other cases, because uses other rounding, and there's nothing immune to the fundamental problem, just because, well, Excel (and Calc) has no fingers and toes.
Or ask the same Excel count =ROUNDDOWN(1234,567-1135,678;3) (since we here talk about ROUNDDOWN). Please stop your ignorant but arrogant narration, and just wait until Eike improves things *as much as possible*.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/8186a01f2a26f05645a2a3c9c93b453bd35b796f Resolves: tdf#138220 tdf#154792 Avoid double rounding; tdf#124286 follow-up It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e68cd91651c53c5c228d84582b1062d8fb9a7077 Add ROUND(DOWN|UP) samples to unit test, tdf#154792 tdf#124286 tdf#138220 It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
*** Bug 154871 has been marked as a duplicate of this bug. ***
I wrote up Bug 154871 thinking that the problem described in Bug 154792 was a different issue (losing several digits of significance vs. a single count in the least significant digit*). *This is how I read it anyway. (ROUNDDOWN(28147497671265.2,0) results in 28147497671300 instead of 28147497671265 (notice ...1300 vs ...1265, a two digit error of 35) and scaling up by x10 scales up the lost data by x10 (a three digit error).) Reading the notes in Bug 154792 suggests that this subject can get a bit deep. I see this function has been modified and will be available with 7.6.0. For now, I'll shelve my observations and defer to the better-informed. When 7.6.0 is released, I will revisit and test.
Pending review https://gerrit.libreoffice.org/c/core/+/150505 for 7-5
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-7-5": https://git.libreoffice.org/core/commit/f0f2ceaf978a0eee8e3c1fcfe6dec546ab8f07d6 Resolves: tdf#138220 tdf#154792 Avoid double rounding; tdf#124286 follow-up It will be available in 7.5.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
This has not been "resolved fixed". Round down errors begin at 12 digits in LibreOffice Calc 7.6. MS Excel exhibits no round down errors. See screen capture image attachments of LOC and MSE. Version: 7.6.0.3 (X86_64) / LibreOffice Community Build ID: 69edd8b8ebc41d00b4de3915dc82f8f0fc3b6265 CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win Locale: en-US (en_US); UI: en-US Calc: threaded
Created attachment 189328 [details] LibreOffice Calc Round Down Errors Screen Capture
Created attachment 189329 [details] MS Excel Round Down No Errors Screen Capture
We do not state a precision higher than 12 significant decimal digits. In fact this is on purpose here, see the change's source code comment: // A quite aggressive approach with 12 significant digits. // However, using 14 or some other doesn't work because other // values may fail, like =ROUNDDOWN(2-5E-015;13) would produce // 2 (another example in tdf#124286). If Excel does not exhibit a round-off _in this case_ then fine for Excel. Otherwise see https://en.wikipedia.org/wiki/Numeric_precision_in_Microsoft_Excel Your screen captures tell nothing by the way, they're different numbers and no indication what actually "fails". If you insist on reopening this bug again, I'm deassigning myself. If you want someone to entirely rewrite the numeric overall behaviour to implement arbitrary-precision arithmetic then this bug is not the place for that.
*** Bug 157082 has been marked as a duplicate of this bug. ***
I seem to remember that a while ago someone tried to fix errors in rounddown and roundup by preceding them with a 'roundsig' to 12 significant digits. Looks as if Eike kept that in his patches, then you may be a victim of the mathematically questionable quality of such measures. Feeding known inaccurate results of subtractions - cancellation - into other formulas and then bending these to ( try to ) produce wanted results for some cases has - IMHO - similar quality.
@erAck, you are sure about 8.23456789013 in the roundup unit-tests? Didn't run the tests, just looked into the code and consider them questionable, think 8.23456789014 fits better. And about the concept, while you accept / provoke contradictions to 'math' in 'digits behind 12' you'll - IMHO - always have cases which fail 'left of that' as the devias propagate left in chains of '000...' or '999...' . And pls. don't answer it has to be like that, it's not a consequence of math, only partly a consequence of IEEE, and mostly resulting from Calc's combination of decisions and algorithms.