Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
test262
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pmaksimo
test262
Commits
55740e93
Commit
55740e93
authored
9 years ago
by
Brian Terlson
Browse files
Options
Downloads
Plain Diff
Merge pull request #334 from arv/fix-math-precision
Fix issue with math_precision.js
parents
c295916c
96e5b67c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
harness/math_precision.js
+11
-13
11 additions, 13 deletions
harness/math_precision.js
with
11 additions
and
13 deletions
harness/math_precision.js
+
11
−
13
View file @
55740e93
// Copyright 2009 the Sputnik authors. All rights reserved.
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
// This code is governed by the BSD license found in the LICENSE file.
function
getPrecision
(
num
)
function
getPrecision
(
num
)
{
{
//TODO: Create a table of prec's,
//TODO: Create a table of prec's,
// because using Math for testing Math isn't that correct.
// because using Math for testing Math isn't that correct.
var
log2num
=
Math
.
log
(
Math
.
abs
(
num
))
/
Math
.
LN2
;
log2num
=
Math
.
log
(
Math
.
abs
(
num
))
/
Math
.
LN2
;
var
pernum
=
Math
.
ceil
(
log2num
);
pernum
=
Math
.
ceil
(
log2num
);
return
2
*
Math
.
pow
(
2
,
-
52
+
pernum
);
return
(
2
*
Math
.
pow
(
2
,
-
52
+
pernum
));
}
//return(0);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment