Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
f1cc2f0d
Commit
f1cc2f0d
authored
27 years ago
by
dtc
Browse files
Options
Downloads
Patches
Plain Diff
Return #C(0.0 0.0) rather than -0.0 for (sqrt -0.0).
parent
ee0ebeac
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
code/irrat.lisp
+2
-10
2 additions, 10 deletions
code/irrat.lisp
with
2 additions
and
10 deletions
code/irrat.lisp
+
2
−
10
View file @
f1cc2f0d
...
...
@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/irrat.lisp,v 1.2
4
1997/1
1/01 22:58:1
4 dtc Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/irrat.lisp,v 1.2
5
1997/1
2/15 06:46:5
4 dtc Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -376,15 +376,7 @@
(
complex-sqrt
number
)
(
coerce
(
%sqrt
(
coerce
number
'double-float
))
'single-float
)))
(((
foreach
single-float
double-float
))
;; NOTE there is a problem with (at least x86 NPX) of what result
;; should be returned for (sqrt -0.0). The x86 hardware FSQRT
;; instruction returns -0d0. The result is that Python will perhaps
;; note the following test in generic sqrt, non-negatively constrained
;; float types will be passed to FSQRT (or libm on other boxes).
;; So, in the interest of consistency of compiled and interpreted
;; codes, the following test is disabled for now. Maybe the float-sign
;; test could be moved to the optimization codes.
(
if
(
<
(
#+
nil
float-sign
#-
nil
identity
number
)
(
if
(
<
(
float-sign
number
)
(
coerce
0
'
(
dispatch-type
number
)))
(
complex-sqrt
number
)
(
coerce
(
%sqrt
(
coerce
number
'double-float
))
...
...
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