Bug SS-3510
1 vote

Rounding error

Created by Martin Kraska on 2/28/2018 3:29 PM Last Updated by smath on 3/6/2018 9:00 AM
%
 (hrs)
Logged: 0   (hrs)

 Description

 

All displayed results on the left side are wrong. This also applies to display of rounded values in significant figures mode

https://de.smath.info/cloud/worksheet/6rhdLZwq

 

SMath Studio: SMath Studio Desktop 0.99.6626.20210, x64
OS: Microsoft Windows NT 6.1.7601 Service Pack 1; Windows 7 Professional Service Pack 1, x64
Screen: 1920x1080 px, 96x96 dpi, 96 GP.DPI, 1 GP.SRF
Localization: language=GER; dec.symbol=<comma>; arg.separator=<semicolon>; OS dec.symbol=<comma>; OS arg.separator=<semicolon>; OS dg.separator=<period>
Framework: CLR 4.0.30319.42000

    installed versions:
    v2.0.50727    2.0.50727.5420 SP2
    v3.0    3.0.30729.5420 SP2
    v3.5    3.5.30729.5420 SP1
    v4    
        Client    4.7.02053
        Full    4.7.02053
    v4.0    
        Client    4.0.0.0

Plugins:
- [AppDir] Area Region - 0.99.6626.20210
- [AppDir] Export to image - 1.10.6626.20213
- [AppDir] HTML Export - 1.13.6626.20212
- [AppDir] Math Region - 0.99.6626.20210
- [AppDir] Picture Region - 1.10.6626.20212
- [AppDir] Plot Region - 1.10.6626.20213
- [AppDir] SMath Studio Files Plugin - 1.10.6626.20213
- [AppDir] SMath Viewer Files Plugin - 1.1.6626.20213
- [AppDir] Special Functions - 1.11.6626.20212
- [AppDir] Special Functions - 1.11.6626.20212
- [AppDir] Standard Toolbox Buttons - 1.1.6626.20214
- [AppDir] Text Region - 1.10.6626.20213
- [AppDir] XMCD Files Plugin - 1.12.6626.20213
- [UserDir] 3D Plot Region (Chart3DLib) - 0.1.6520.38983
- [UserDir] 3D Plot Region (Chart3DLib) - 0.1.6520.38983
- [UserDir] ALGLIB® - numerical analysis library - 1.0.6520.38988
- [UserDir] Checkbox Region - 1.0.6353.41257
- [UserDir] CheckBoxList Region - 1.0.6492.12167
- [UserDir] Combobox Region - 0.1.6353.41267
- [UserDir] ComboBoxList Region - 1.0.6492.12187
- [UserDir] Conditionally Formatted Label - 1.0.6353.24522
- [UserDir] CoolProp Wrapper - 6.1.6353.42876
- [UserDir] Currency Units - 1.0.6353.24527
- [UserDir] Custom Functions - 1.1.6522.6678
- [UserDir] Custom Glyphs - 1.1.6353.24538
- [UserDir] Data Exchange - 1.1.6499.5086
- [UserDir] Development Tools - 1.0.6628.32998
- [UserDir] DISLIN 10.6 - 0.1.6520.39019
- [UserDir] DotNumerics - 1.1.6520.39025
- [UserDir] EFI for SMath Studio - 1.0.6520.39032
- [UserDir] EXCEL (2003+) I/O with recalculation and PNG export - 1.99.6354.6352
- [UserDir] Excel Files Plugin - 1.3.6611.15994
- [UserDir] FFTPACK - 1.0.6353.24645
- [UserDir] FIR Filters Design - 1.0.6520.39036
- [UserDir] GPC Wrapper - 1.0.6353.25369
- [UserDir] Hyperlink Region - 1.0.6624.28014
- [UserDir] Image Region - 2.99.6527.16399
- [UserDir] include - 0.1.6538.12588
- [UserDir] Maple Wrapper - 1.0.6520.39056
- [UserDir] Maple Wrapper - 1.0.6520.39056
- [UserDir] Maple Wrapper - 1.0.6520.39056
- [UserDir] Mathcad File Access Functions - 1.0.6520.39061
- [UserDir] MaximaPlugin - 1.98.6519.13993
- [UserDir] Modeller Region - 1.0.6353.23719
- [UserDir] Nonlinear Solvers - 1.1.6353.25410
- [UserDir] Numeric Up-Down Region - 1.0.6492.12196
- [UserDir] ODE Solvers - 0.1.6520.39104
- [UserDir] PDF Files Plugin - 1.0.6353.25356
- [UserDir] Pie Chart Region - 1.0.6353.26771
- [UserDir] RadioButtonList Region - 1.0.6492.12200
- [UserDir] Script Region - 0.1.6520.39109
- [UserDir] Slider Region - 1.0.6492.12208
- [UserDir] Snapshot Region - 1.0.6446.14076
- [UserDir] Statistical Tools - 1.0.6599.21762
- [UserDir] Table Region - 0.2.6611.27462
- [UserDir] Text Region Utilities - 0.3.6353.26919
- [UserDir] Writer Region - 0.9.6604.42933
- [UserDir] XLSX Import/Export - 1.1.6616.19995
- [UserDir] X-Y Plot Region (Chart2DLib) - 0.1.6520.39122
 

    smath (Tuesday, March 6, 2018 9:00 AM) #

Martin.

Initially round function worked using "away from zero", but all the answers was shown using "to even". At some point I realized that this must be normalized somehow.

I have switched answers to "away from zero" in nightly build but after your comment I have investigated what other programs offers regarding rounding. After this investigation I decided to switch everything from "away from zero" to "to even" and provide a setting for both: ui and calculation engine.

This is actually what I did in latest nightly build.

Good thing here is that SMath Studio is now respects rounding standards, have good compatibility with other software and it is now allows to use different rounding algorithms for calculations and visualization depends on situation and data origin. This is unique feature actually (not many programs allows this).

 

Best regards.

    Martin Kraska (Tuesday, March 6, 2018 1:23 AM) #

I see that in 6638 round to even is default again. Thanks a lot for this.

How come? I wasn't feeling any support for this in the forum.

BTW, the help text for round(3) should be updated.

 

    Davide (Friday, March 2, 2018 10:50 AM) #

Even in italy the round away from zero is called simply rounding or mathematical rounding while the round to odd/even is called banking rounding :-)

    smath (Friday, March 2, 2018 12:46 AM) #

In Russia we have

away from zero: Mathemetical
round to even: Bankers

:)

    Martin Kraska (Thursday, March 1, 2018 9:15 PM) #

It is funny that in Germany the unbiased  round to even is called mathematical, and away from zero is called commercial

In Russia, it is the other way around, according to wikipedia.

    Martin Kraska (Wednesday, February 28, 2018 8:52 PM) #

I agree that the second line is correct.

But 1,2345 rounded to 3 decimal places should be 1,234 (round to even if the last nonzero digit is 5)

    smath (Wednesday, February 28, 2018 8:43 PM) #

Issue is fixed. Error was in rounding values when Significant Figures is turned on.

Thank you!

    smath (Wednesday, February 28, 2018 7:59 PM) #

I think that incorrect is only first entry in https://de.smath.info/cloud/worksheet/6rhdLZwq. The second one looks correct as 1.2345 rounded to 3 decimal places should be 1.235.