Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8323199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:39:00+00:00 2026-06-08T23:39:00+00:00

This is in both common lisp (clisp and sbcl) and scheme (guile). While these

  • 0

This is in both common lisp (clisp and sbcl) and scheme (guile). While these are true:

(= 1/2 0.5)
(= 1/4 0.25)

This turns out to be false:

(= 1/5 0.2)

I checked the hyperspec, it says that “=” should check for mathematical equivalency despite the types of the arguments. What the heck is going on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:39:02+00:00Added an answer on June 8, 2026 at 11:39 pm

    The problem is that 0.2 really is not equal to 1/5. Floating point numbers cannot represent 0.2 correctly, so the literal 0.2 is actually rounded to the nearest representable floating point number (0.200000001 or something like that). After this rounding occurs, the computer has no way of knowing that your number was originally 0.2 and not another nearby non-representable number (such as 0.20000000002).

    As for the reason why 1/2 and 1/4 work its because floating point is a base 2 encoding and can accurately represent powers of two.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new on both this site and ruby on rails! I have a common
I can't figure out why this is returning both occurrences of the string /Most
I tagged this question both Java and Scala because while I mainly develop on
I have tried this both on Ubuntu Linux and on Windows. I can not
I tested this on both .Net 4.0 and .Net 4.0 CP, same result. This
I've done some research on this question (both via google and on here), but
(Bonus internets for anyone who can explain how I can do this in both
Why do this Ruby object both a to_s and inspect methods that appear to
I get this behavior in both Chrome (Developer Tools) and Firefox (Firebug). Note the
On the php documentation,i found this note: On both 32 and 64-bit systems (OS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.