Small incompatibility with mod operator/function

This forum is meant for questions and discussions about the X# language and tools
User avatar
wriedmann
Posts: 3681
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Small incompatibility with mod operator/function

Post by wriedmann »

Hi Arne,
please let me add my 0.2 cents: I expect that a lot of rounding errors will be gone only moving from float to decimal.... decimal may be slower than "classic" numeric datatypes, but that is irrelevant.
This will be the most important thing in a .NET migration (my first programming job was using Cobol<g>).
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
ArneOrtlinghaus
Posts: 393
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Small incompatibility with mod operator/function

Post by ArneOrtlinghaus »

Hi Wolfgang,
yes, I see it like you. But: ... everything must work with decimal.
- There mustn't be any function in between that uses double (self written or basic X# function)
- Every use of a database/file/control input/output in between must be verified separately, because here mechanisms are used outside of the decimal calculation.

What should remain are the roundings that are prescribed by business rules, for example tax roundings or currency exchange roundings.
User avatar
wriedmann
Posts: 3681
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Small incompatibility with mod operator/function

Post by wriedmann »

Hi Arne,
I agree with you.
IMHO there should be an option in the RDD that every numeric field get with decimals should return a decimal instead of a float.
If I remember correctly, Robert had written sometimes ago that the runtime would see untyped numeric datatypes with decimals as "decimal" datatype and not more as float.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply