Click here to Skip to main content
15,914,452 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralHow hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
swampwiz9-Jul-18 5:09
swampwiz9-Jul-18 5:09 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
OriginalGriff9-Jul-18 5:10
mveOriginalGriff9-Jul-18 5:10 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
megaadam9-Jul-18 5:14
professionalmegaadam9-Jul-18 5:14 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
Pete O'Hanlon9-Jul-18 5:16
mvePete O'Hanlon9-Jul-18 5:16 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
OriginalGriff9-Jul-18 5:25
mveOriginalGriff9-Jul-18 5:25 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
PIEBALDconsult9-Jul-18 8:41
mvePIEBALDconsult9-Jul-18 8:41 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
OriginalGriff9-Jul-18 9:38
mveOriginalGriff9-Jul-18 9:38 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
kalberts9-Jul-18 11:39
kalberts9-Jul-18 11:39 
As a rational number? I believe 23/7 comes close, but if you want, you can find even closer rational numbers.

pi isn't a rational number.

With irrational numbers, there would be roundoff problems, although small ones. Most our everyday problems end up in rational numbers. It isn't difficult to implement a rational number type with modern OO languages.
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
swampwiz9-Jul-18 13:40
swampwiz9-Jul-18 13:40 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
kalberts10-Jul-18 3:37
kalberts10-Jul-18 3:37 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
CPallini9-Jul-18 21:15
mveCPallini9-Jul-18 21:15 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
obermd10-Jul-18 5:28
obermd10-Jul-18 5:28 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
megaadam9-Jul-18 5:14
professionalmegaadam9-Jul-18 5:14 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
GuyThiebaut9-Jul-18 6:44
professionalGuyThiebaut9-Jul-18 6:44 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
kalberts9-Jul-18 11:40
kalberts9-Jul-18 11:40 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
harold aptroot9-Jul-18 7:52
harold aptroot9-Jul-18 7:52 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
PIEBALDconsult9-Jul-18 8:22
mvePIEBALDconsult9-Jul-18 8:22 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
kalberts9-Jul-18 11:41
kalberts9-Jul-18 11:41 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
Super Lloyd9-Jul-18 14:10
Super Lloyd9-Jul-18 14:10 
AnswerRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
John Stewien10-Jul-18 0:03
John Stewien10-Jul-18 0:03 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
gdemont10-Jul-18 2:20
gdemont10-Jul-18 2:20 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
kalberts10-Jul-18 4:12
kalberts10-Jul-18 4:12 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
swampwiz10-Jul-18 4:47
swampwiz10-Jul-18 4:47 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
Kirk 1038982110-Jul-18 3:50
Kirk 1038982110-Jul-18 3:50 
GeneralRe: How hard would it be to have a Rational Number type, so that there would never be floating point errors? Pin
kalberts10-Jul-18 4:24
kalberts10-Jul-18 4:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.