Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
explelibx-mgrid
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
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
Vladimir Onoprienko
explelibx-mgrid
Merge requests
!1
Draft: Fix mul() to work with negative arguments
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Draft: Fix mul() to work with negative arguments
sign
into
main
Overview
2
Commits
1
Pipelines
0
Changes
1
1 unresolved thread
Hide all comments
Open
Vladimir Onoprienko
requested to merge
sign
into
main
3 years ago
Overview
2
Commits
1
Pipelines
0
Changes
1
1 unresolved thread
Hide all comments
Expand
This merge request should solve
#1 (closed)
and
#2 (closed)
Edited
3 years ago
by
Vladimir Onoprienko
0
0
Merge request reports
Compare
main
main (HEAD)
and
latest version
latest version
f8c22c3e
1 commit,
3 years ago
1 file
+
10
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
explelibx-mgrid/exple-mul.cpp
+
10
−
2
Options
#include
"exple-mul.h"
int
sgn
(
int
val
)
{
return
(
0
<
val
)
-
(
val
<
0
);
}
int
abs
(
int
a
)
{
return
(
a
>=
0
)
?
a
:
-
a
;
}
int
exple
::
mul
(
int
a
,
int
b
)
{
int
result
=
0
;
for
(
int
n
=
0
;
n
<
b
;
n
++
)
for
(
int
n
=
0
;
n
<
abs
(
b
)
;
n
++
)
{
result
+=
a
;
}
return
result
;
return
result
*
sgn
(
b
)
;
}
Loading