Closed Lingyis closed 10 years ago
Note, that that behavior breaks the recommended (see #6) way to check whether the scientific number is an integer. what about the following
scientific :: Integer -> Int -> Scientific
scientific c e = case quotRem c 10 of
(c', 0) -> scientific c' (e+1)
_ -> Scientific c e
and add a new function
uncheckedScientific :: Integer -> Int -> Scientific
uncheckedScientific = Scientific
The scientific function in scientific-0.3 now normalizes.
Just a heads up. I'm actually getting back on this. I now moved normalization from construction time (in the scientific
function) to pretty-printing time (in toFloatDigits
). The reason is performance: I don't want to normalize on construction each time.
I noted this in the documentation.
Using the routine
scientific
, while documented to use a user provided coefficient and exponent, should have the behavior that it returns a valid scientific number. I.e. currently:However, what a scientific number should return, is a coefficient of 1 and a base10Exponent of 4.
Not technically a bug, but it violates a user's expectation of a scientific number, since it is specifically stated in the documentation that the module uses scientific notation, with a link to the Wiki page.
The function should properly convert user input to an actual scientific notation number. Failing that, should create a new function like
properScientific
that creates a proper scientific number.