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

  • Home
  • SEARCH
  • 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 8399251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:15:05+00:00 2026-06-09T21:15:05+00:00

​document.writeln(Math.floor(43.9)); ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​produces 43 in the browser. ​document.writeln(Math.floor(43.9999));​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ produces 43 ​document.writeln(Math.floor(43.999999999999));​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ again 43 However, document.writeln(Math.floor(43.99999999999999));

  • 0
    ​document.writeln(Math.floor(43.9));

​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​produces 43 in the browser.

​document.writeln(Math.floor(43.9999));​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

produces 43

 ​document.writeln(Math.floor(43.999999999999));​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ 

again 43

However,

    document.writeln(Math.floor(43.99999999999999));

produces 44.

The magic number of 9’s after the decimal point seems to be 15*.

Why is this?

Furthermore, Does the Math.floor function accept the number as a number object, or a number value?

  • 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-09T21:15:06+00:00Added an answer on June 9, 2026 at 9:15 pm

    The IEEE 754 double-precision binary floating-point format (which is what JavaScript uses for its Number type) gives you a precision of 15 – 17 significant decimal digits.

    This gives from 15 – 17 significant decimal digits precision. If a
    decimal string with at most 15 significant decimal is converted to
    IEEE 754 double precision and then converted back to the same number
    of significant decimal, then the final string should match the
    original; and if an IEEE 754 double precision is converted to a
    decimal string with at least 17 significant decimal and then converted
    back to double, then the final number must match the original [1].

    Source: http://en.wikipedia.org/wiki/Double-precision_floating-point_format#IEEE_754_double-precision_binary_floating-point_format:_binary64

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

Sidebar

Related Questions

Why does document.writeln(a || b) print a instead of true ? document.writeln(a && b)
I've got the following javascript writing HTML for FlexPlayer: document.writeln(<object width=\489\ height=\414\ FlashVars=\+videoSource+\>); document.writeln(<param
I was just writing some simple code and I noticed that using document.writeln doesn't
I'm reading in JavaScript for Dummies, page 29 and it is showing the document.writeln
Consider two web pages with the following in their body respectively: <body> <script> document.writeln('<textarea></textarea>')
With the following line of code: document.writeln(blahblahblah) I expect the content to be placed
What is the difference between document.write(‘hello world\n’); and document.writeln(‘hello world’); ? Edit My question
var my = {}; my[1] = tom; my[2] = tony; document.writeln(my[2]); A simple question,
<script type='text/javascript'> //<![CDATA[ for(var j = 0; j < 6;) { document.writeln(++j); } //]]>
document.forms[regform][fname].value; In java script i get the value of input having name(fname) which is

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.