You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The conversion between decimal numbers (used in _createRational1() ), stored as floating point variables and rational numbers has been implemented in the easiest way possible - the numerator is get by multiplying the float number by some fixed number with value 10^n while the denominator is simplu 10^n. That may lead to errors while converting big numbers (variables can easly overflow) as well as might not be accurate - we want to be able to convert 0.33333333333 to 1/3. There is a need to implement the conversion based on the theory of continued fractions.
Function to be rewritten: void approximate(double x, int* nominator, int* denominator)
The conversion between decimal numbers (used in _createRational1() ), stored as floating point variables and rational numbers has been implemented in the easiest way possible - the numerator is get by multiplying the float number by some fixed number with value 10^n while the denominator is simplu 10^n. That may lead to errors while converting big numbers (variables can easly overflow) as well as might not be accurate - we want to be able to convert 0.33333333333 to 1/3. There is a need to implement the conversion based on the theory of continued fractions.
Function to be rewritten: void approximate(double x, int* nominator, int* denominator)
https://stackoverflow.com/questions/95727/how-to-convert-floats-to-human-readable-fractions
The text was updated successfully, but these errors were encountered: