Talk:Getting the number of decimal places: Difference between revisions

From Rosetta Code
Content added Content deleted
(Fractions? Trailing zeros?)
 
m (→‎Fractions? Trailing Zeros?: mention imaginary numbers)
Line 6: Line 6:
Floating point numbers may also be problematic as mentioned in the Raku entry. By the way, how many decimal places does fp-zero have? How about fp-infinity?
Floating point numbers may also be problematic as mentioned in the Raku entry. By the way, how many decimal places does fp-zero have? How about fp-infinity?


Should we also handle other numeric types with decimal points? Many languages feature some sort of 'BigDecimal' type, for example.
Should we also handle other numeric types with decimal points? Many languages feature some sort of 'BigDecimal' type and imaginary number type, for example.


It would be nice if the task description could elaborate on some of the above concerns. A restriction of the scope of the task (beyond merely 'numbers'), as well as having an actual task to solve beyond a couple cryptic inputs and outputs would be much appreciated as well. --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 12:22, 13 August 2020 (UTC)
It would be nice if the task description could elaborate on some of the above concerns. A restriction of the scope of the task (beyond merely 'numbers'), as well as having an actual task to solve beyond a couple cryptic inputs and outputs would be much appreciated as well. --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 12:22, 13 August 2020 (UTC)

Revision as of 12:32, 13 August 2020

Fractions? Trailing Zeros?

What exactly is meant by 'number' in the task description? Fractions are numbers. 1/4 is a fraction whose decimal expansion contains two decimal places. 1/3 is a fraction whose decimal expansion contains an infinite number of decimal places. Are we not meant to handle fractions, even if our language features them as first-class literals?

Can we also get some clarity regarding trailing zeros? Most languages feature numeric types that do not retain trailing zeros. I see that some entries are using strings for these cases instead. Is that intended by the task?

Floating point numbers may also be problematic as mentioned in the Raku entry. By the way, how many decimal places does fp-zero have? How about fp-infinity?

Should we also handle other numeric types with decimal points? Many languages feature some sort of 'BigDecimal' type and imaginary number type, for example.

It would be nice if the task description could elaborate on some of the above concerns. A restriction of the scope of the task (beyond merely 'numbers'), as well as having an actual task to solve beyond a couple cryptic inputs and outputs would be much appreciated as well. --Chunes (talk) 12:22, 13 August 2020 (UTC)