13 Replies - 1463 Views - Last Post: 26 October 2019 - 02:17 PM

#1 dgenxxx   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 24-October 19

Most accurate representation of 19.55

Posted 24 October 2019 - 01:41 PM

Hi,
so I've used a binary calculator to help me with a coursework. I made a conversion of 19.55 and the most accurate representation of that is 1.9549999237060546875E1. Unfortunately I was asked to provide a step by step analysis of how I got the answer. Any insight will be appreciated.
Is This A Good Question/Topic? 0
  • +

Replies To: Most accurate representation of 19.55

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15308
  • View blog
  • Posts: 61,391
  • Joined: 12-June 08

Re: Most accurate representation of 19.55

Posted 24 October 2019 - 01:47 PM

Conversion from what to what?
Was This Post Helpful? 0
  • +
  • -

#3 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11679
  • View blog
  • Posts: 19,840
  • Joined: 19-March 11

Re: Most accurate representation of 19.55

Posted 24 October 2019 - 01:47 PM

What have you got so far?
Was This Post Helpful? 0
  • +
  • -

#4 dgenxxx   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 24-October 19

Re: Most accurate representation of 19.55

Posted 24 October 2019 - 01:54 PM

View Postmodi123_1, on 24 October 2019 - 01:47 PM, said:

Conversion from what to what?


19.55 = 1.9549999237060546875E1
Was This Post Helpful? 0
  • +
  • -

#5 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7095
  • View blog
  • Posts: 24,113
  • Joined: 05-May 12

Re: Most accurate representation of 19.55

Posted 24 October 2019 - 03:20 PM

View Postdgenxxx, on 24 October 2019 - 04:41 PM, said:

Hi,
so I've used a binary calculator to help me with a coursework. I made a conversion of 19.55 and the most accurate representation of that is 1.9549999237060546875E1. Unfortunately I was asked to provide a step by step analysis of how I got the answer. Any insight will be appreciated.

Well you could tell your professor in exquisite detail about what website you went to, and that you typed in, and what buttons you clicked. Sounds like a step-by-step analysis to me. :)

What you really should do is how you would derive this value by hand instead of just using a binary calculator.

Perhaps this may help: What Every Computer Scientist Should Know About Floating-Point Arithmetic
Was This Post Helpful? 2
  • +
  • -

#6 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5485
  • View blog
  • Posts: 14,448
  • Joined: 18-April 07

Re: Most accurate representation of 19.55

Posted 24 October 2019 - 04:09 PM

I say ask macosxnerd101. He could tell you the math behind it and give you a detailed analysis and pie charts, bar charts, line charts and even intergalactic star charts. He is the local DIC math prophet who speaks the true words of thy math gods. But be careful when you ask, for if he damns you and casts you down you will find yourself if computational purgatory. May I suggest you come bearing some kind of compliment on his mathematical superiority and offer a tribute of a graphing calculator.

:D

This post has been edited by Martyr2: 24 October 2019 - 04:10 PM

Was This Post Helpful? 1
  • +
  • -

#7 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12657
  • View blog
  • Posts: 45,830
  • Joined: 27-December 08

Re: Most accurate representation of 19.55

Posted 24 October 2019 - 07:13 PM

The issue isn't representing 19.55. The issue comes from the calculations you did along the way, where precision was an issue at intermediary steps.

Quote

so I've used a binary calculator to help me with a coursework.


Are you sure 19.55 is the correct answer? Is this the answer you got when working things out by hand?

Quote

Unfortunately I was asked to provide a step by step analysis of how I got the answer.


This is not unfortunate. This means your instructor is expecting you to learn how to do things and understand the techniques, rather than to use tools that do things for you.

Quote

May I suggest you come bearing some kind of compliment on his mathematical superiority and offer a tribute of a graphing calculator.


I prefer the term "mathematical excellence" rather than "mathematical superiority." I think most people can be mathematically excellent! :)
Was This Post Helpful? 1
  • +
  • -

#8 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11679
  • View blog
  • Posts: 19,840
  • Joined: 19-March 11

Re: Most accurate representation of 19.55

Posted 24 October 2019 - 07:42 PM

View Postmacosxnerd101, on 24 October 2019 - 09:13 PM, said:

I prefer the term "mathematical excellence" rather than "mathematical superiority." I think most people can be mathematically excellent! :)/>



But surely "excellent" implies "above average", so this would imply that most people can be "mathematically above average", which is a contradiction.

Boom.
Was This Post Helpful? 2
  • +
  • -

#9 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12657
  • View blog
  • Posts: 45,830
  • Joined: 27-December 08

Re: Most accurate representation of 19.55

Posted 24 October 2019 - 07:50 PM

We can replace excellent with words like proficient, competent, and good. I like to think people can become all of these things at math, and that this isn't something reserved for the gods and those who use amphetamines. :)
Was This Post Helpful? 0
  • +
  • -

#10 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4239
  • View blog
  • Posts: 13,441
  • Joined: 08-June 10

Re: Most accurate representation of 19.55

Posted 25 October 2019 - 02:03 AM

View Postjon.kiparsky, on 25 October 2019 - 04:42 AM, said:

But surely "excellent" implies "above average"

in most (commonly known) statistics, 50% (of the items in the set) are "above average".
Was This Post Helpful? 0
  • +
  • -

#11 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11679
  • View blog
  • Posts: 19,840
  • Joined: 19-March 11

Re: Most accurate representation of 19.55

Posted 25 October 2019 - 07:41 AM

Indeed.
Was This Post Helpful? 0
  • +
  • -

#12 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5485
  • View blog
  • Posts: 14,448
  • Joined: 18-April 07

Re: Most accurate representation of 19.55

Posted 25 October 2019 - 04:18 PM

If you close your eyes, you can almost envision Mac, draped in robes of simple cotton and wearing worn sandals that were fashioned by an old woman, slowly walking and speaking the words which will become the math bible. He places his hand on the head of a young student and says "We can replace excellent with words like proficient, competent, and good. I like to think people can become all of these things at math, and that this isn't something reserved for the gods and those who use amphetamines."

:innocent:

This post has been edited by Martyr2: 25 October 2019 - 04:19 PM

Was This Post Helpful? 0
  • +
  • -

#13 sepp2k   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2754
  • View blog
  • Posts: 4,414
  • Joined: 21-June 11

Re: Most accurate representation of 19.55

Posted 26 October 2019 - 05:50 AM

View Postdgenxxx, on 24 October 2019 - 10:41 PM, said:

I made a conversion of 19.55 and the most accurate representation of that is 1.9549999237060546875E1. Unfortunately I was asked to provide a step by step analysis of how I got the answer.


If you've read and understood everything in Skydiver's link, this should become easy, but since that article is maybe a bit heavy, here's another link addressing specifically how to convert a decimal number to float. So do that, convert the result back to a decimal number and you'll get your 19.549999237060546875.

View Postmodi123_1, on 24 October 2019 - 10:47 PM, said:

Conversion from what to what?


Presumably from a real number to a single precision IEEE binary floating point value (using double precision, the result would just be 19.55).

View Postmacosxnerd101, on 25 October 2019 - 04:13 AM, said:

The issue isn't representing 19.55.


It seems to me that's exactly the issue.

Quote

Are you sure 19.55 is the correct answer? Is this the answer you got when working things out by hand?


19.55 isn't the answer, it's the question (or rather "What's the most accurate floating point represenation of 19.55?" is the question). The answer is 19.549999237060546875 (again, assuming single precision) and OP is asking how to get to that answer without using tools.
Was This Post Helpful? 0
  • +
  • -

#14 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12657
  • View blog
  • Posts: 45,830
  • Joined: 27-December 08

Re: Most accurate representation of 19.55

Posted 26 October 2019 - 02:16 PM

@sepp2k- The OP stated:

Quote

so I've used a binary calculator to help me with a coursework. I made a conversion of 19.55


This makes me think there is more to it than just converting 19.55 to binary.

Quote

19.55 isn't the answer, it's the question


It's the question the OP is asking, but I'm not entirely sold that this is the question being asked on the homework assignment. I could certainly be totally off-base here.

This post has been edited by macosxnerd101: 26 October 2019 - 02:17 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1