12

1.265 * 10000 = 126499.99999999999?

 2 years ago
source link: https://www.codesd.com/item/1-265-10000-126499-99999999999.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

1.265 * 10000 = 126499.99999999999?

advertisements

This question already has an answer here:

  • Is floating point math broken? 30 answers

When I multiply 1.265 by 10000 , I get 126499.99999999999 when using Javascript.

Why is this so?


Floating point numbers can't handle decimals correctly in all cases. Check out

Related Articles

How to work around the decimal problem in JavaScript?

Possible Duplicates: Strange problem comparing floats in objective-C Is JavaScript's math broken? 1.265 * 10000 = 126499.99999999999 ????? After watching this I discovered that in JavaScript: 0.1 + 0.2 === 0.3 evaluates to false. Is there a way to wo

How to convert video from H.264 to H.265

I write a Winform app have 2 function : play video (use vlc videolan active plugin) and convert video to H.265. But I dont know use which library for converting (example code if maybe). Anyone can help me. Thanks and best reagards.You can use FFMpeg

Obtain the auditor's expiration after waiting for [10000] ms of ElasticsearchIO

I am trying to test a simple Apache Beam code with source as Elasticsearch. I found the ElasticsearchIO source class from the git repo. I modified Beam's MinimalWordCount example to include source as Elasticsearch instead of TextIO. Below is the gist

No messages in 10000 ms. Jasmine Karma RequireJSS

I started without knowing much in AngularJS. When I run : .\node_modules\.bin\karma start karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=PhantomJS I get the following message : WARN [PhantomJS 1.9.8 (Windows 7 0.0.0)]: Disconn

The operation expired after 10000 milliseconds during security: check in symfony

It is my first installation according to http://symfony.com/doc/current/book/installation.html. Here is the history commands on my console. curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony chmod a+x /usr/local/bin/symfony symfony -v

Disconnected (1 time) because no 10000 ms message using Karma-Jasmine

Using Karma runner with jasmine. After all the configuration done, i an on terminal the below command: karma start public/javascripts/karma.conf.js But i am getting the below error where my browser is getting closed. INFO [karma]: Karma v0.12.16 serv

Python - need help to loop a list through functions using 4 different ranges (0-25, 0-100, 0-1000, 0-10000)

Python Version - 3.3.2 I am writing a Python program that sets a list equal to a range of numbers (0-25), shuffles these numbers randomly and then sorts these numbers using four different sorting functions: bubble sort, selection sort, python sort, a

Maximum size of call stack exceeded on documents of insertion 10000

This is the code am running which returns the Range Maximum call stack size exceeded error. // to insert 10000 values on to mongodb using node.js var MongoClient = require('mongodb').MongoClient; var mongoServer = require('mongodb').Server; var serve

Using very long strings (10000 characters) as the SqlParameter value

I am trying to execute an insert command into the database and one of the columns is of type nvarchar(MAX). Insert command is created by using .NET SqlCommand class and each of the parameters is represented by one SqlParameter object. My command gets

The year * 10000 + month * 100 + day monotone?

Simple question: is year * 10000 + month * 100 + day always increasing? For example, today would is 20121011 and tomorrow is 20121012, which is 1 higher. Is this always the case? I've heard of some crazy stuff happening with dates and times before, b

Algorithm to convert md5 (or perhaps another hash method?) Whole where it is possible to define resulting whole ranges (eg 1-10000)?

the topic pretty much describes what we would like to accomplish. a) start with a possible range of integers, for example, 1 to 10000. b) take any md5 hash, run it thru this algo. c) result that pops out will be an integer between 1 to 10000. we are

IndexError: index 10000 is out of range for axis 0 with size 10000

For my physics degree I have to take some Python lessons. I'm an absolute beginner and as such I can't understand other answers (I'm really busy atm unfortunately :/). The code is to plot an object's trajectory with air resistance. I would really app

Finding a particular string pattern on 10000 files in parallel

Problem Statement:- I need to search a particular String Pattern in around 10000 files and find the records in the files which contains that particular pattern. I can use grep here, but it is taking lots of time. Below is the command I am using to se

Heatmap with 10000 * 400 points in java

I want to show users a heatmap with 10000 * 400 tiles. Current state in my program is that I have a class which is a JComponent. In this JComponent, I have instances of Image for the tiles. If I had a 300 * 300 matrix, the program uses between 800 an

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK