Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
aa29f9b9
Commit
aa29f9b9
authored
Aug 04, 1993
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Frem): Don't accept floats, just ints and markers.
parent
2adf4f61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
26 deletions
+1
-26
src/data.c
src/data.c
+1
-26
No files found.
src/data.c
View file @
aa29f9b9
...
...
@@ -1736,39 +1736,14 @@ The arguments must be numbers or markers.")
DEFUN
(
"%"
,
Frem
,
Srem
,
2
,
2
,
0
,
"Returns remainder of first arg divided by second.
\n
\
Both must be
numb
ers or markers."
)
Both must be
integ
ers or markers."
)
(
num1
,
num2
)
register
Lisp_Object
num1
,
num2
;
{
Lisp_Object
val
;
#ifdef LISP_FLOAT_TYPE
CHECK_NUMBER_OR_FLOAT_COERCE_MARKER
(
num1
,
0
);
CHECK_NUMBER_OR_FLOAT_COERCE_MARKER
(
num2
,
0
);
if
(
XTYPE
(
num1
)
==
Lisp_Float
||
XTYPE
(
num2
)
==
Lisp_Float
)
{
double
f1
,
f2
;
f1
=
XTYPE
(
num1
)
==
Lisp_Float
?
XFLOAT
(
num1
)
->
data
:
XINT
(
num1
);
f2
=
XTYPE
(
num2
)
==
Lisp_Float
?
XFLOAT
(
num2
)
->
data
:
XINT
(
num2
);
if
(
f2
==
0
)
Fsignal
(
Qarith_error
,
Qnil
);
#if defined (USG) || defined (sun) || defined (ultrix) || defined (hpux)
f1
=
fmod
(
f1
,
f2
);
#else
f1
=
drem
(
f1
,
f2
);
#endif
/* If the "remainder" comes out with the wrong sign, fix it. */
if
((
f1
<
0
)
!=
(
f2
<
0
))
f1
+=
f2
;
return
(
make_float
(
f1
));
}
#else
/* not LISP_FLOAT_TYPE */
CHECK_NUMBER_COERCE_MARKER
(
num1
,
0
);
CHECK_NUMBER_COERCE_MARKER
(
num2
,
1
);
#endif
/* not LISP_FLOAT_TYPE */
if
(
XFASTINT
(
num2
)
==
0
)
Fsignal
(
Qarith_error
,
Qnil
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment