Skip to content

Conversation

angularsen
Copy link
Owner

@angularsen angularsen commented Dec 29, 2020

Decimal fraction is not a correct term.

Definition of Decimal Fraction
A fraction where the denominator (the bottom number) is a power of ten (such as 10, 100, 1000, etc).
Source.

So, to convert a fraction to a decimal, divide the numerator by the denominator.
Source.

Changes

  • Add Ratio.Decimal unit, mark DecimalFraction unit as obsolete
  • Add RatioChangeRate.DecimalPerSecond, mark DecimalFractionPerSecond unit as obsolete
  • Change base unit of each quantity to the new unit

Changing the base unit should not be a breaking change for most users and the conversion precision is exactly the same as before for all units.

@angularsen
Copy link
Owner Author

Related to #879

@lipchev
Copy link
Collaborator

lipchev commented Dec 29, 2020

I'm not sure about this- the linked definition emphasizes the distinction between 1/2 (fraction) and 5/10 (decimal fraction). However what we're representing is the right hand side of the equation: e.g. 0.53 which is the decimal value representation of a fraction (i.e. using a decimal symbol).

@angularsen
Copy link
Owner Author

@lipchev Good point, some more googling and I believe decimal is the correct term?

So, to convert a fraction to a decimal, divide the numerator by the denominator.
https://www.bbc.co.uk/bitesize/topics/znmtsbk/articles/z4ymtv4

@angularsen
Copy link
Owner Author

Updated PR to use Decimal and updated both Ratio and RatioChangeRate.

@angularsen angularsen changed the title Add Ratio.Fraction and deprecate DecimalFraction Rename DecimalFraction units to Decimal Dec 29, 2020
@MarkCiliaVincenti
Copy link
Contributor

The problem with Ratio.Decimal is that decimal is a type in C#, so it could create confusion.

@angularsen
Copy link
Owner Author

@MarkCiliaVincenti Right, but since its type is double I think maybe not a big problem.
After reading up on the terms I believe DecimalFraction is not a good choice either.

Are we happy with Decimal? Any other suggestions?
@lipchev @MarkCiliaVincenti

@lipchev
Copy link
Collaborator

lipchev commented Jan 13, 2021

I personally prefer DecimalFraction over Decimal: we're represents a Ratio in terms of a Decimal Fraction expressed (visually) using the

modern European decimal notation

I also think that renaming this would have quite a visible effect on client code (having obsolete warnings popping all over the place), that it simply wouldn't be worth the effort..

@angularsen
Copy link
Owner Author

@lipchev Ok, I had not considered the "visual representation" part. I guess it makes sense when reading the wiki section.

https://en.wikipedia.org/wiki/Decimal#Decimal_fractions

The numbers that are represented by decimal numerals are the decimal fractions (sometimes called decimal numbers),
For example, the numerals
image
represent the fractions
image

I guess we could call it DecimalNumeral, but that is a very unfamiliar term to me at least.
I agree, not worth the hassle. Let's stick with DecimalFraction.

@angularsen angularsen closed this Jan 13, 2021
@angularsen angularsen deleted the add-ratio-fraction branch November 20, 2022 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants