Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
LAMP
Commits
d82658f8
Commit
d82658f8
authored
Jun 12, 2019
by
Gonzalez, Miguel
Browse files
Use long integers for Z parameter to avoid overflows after x1000 multiplication
parent
e805566f
Changes
1
Hide whitespace changes
Inline
Side-by-side
lamp_mac/SALSA/salsa_combine_ws.pro
View file @
d82658f8
...
...
@@ -24,7 +24,7 @@ function salsa_combine_ws, wks_list
;
convert
float
values
to
integer
(
after
multiplying
by
1000
)
to
search
unique
values
;
z_out
contains
the
output
values
,
zcomp
the
values
to
compare
(
integers
or
strings
)
if
typename
(
zpar
)
eq
'FLOAT'
then
begin
zpar
=
fix
(
zpar
*
1000
)
zpar
=
long64
(
zpar
*
1000
)
zcomp
=
zpar
[
uniq
(
zpar
,
sort
(
zpar
))]
z_out
=
zpar
[
uniq
(
zpar
,
sort
(
zpar
))]
/
1000
.
endif
else
begin
...
...
@@ -70,7 +70,7 @@ function salsa_combine_ws, wks_list
;
check
Z
values
and
sum
together
equivalent
points
zval
=
pstruct
.
z
if
typename
(
zval
)
eq
'FLOAT'
then
begin
zval
=
fix
(
zval
*
1000
)
zval
=
long64
(
zval
*
1000
)
zval
=
zval
[
uniq
(
zval
,
sort
(
zval
))]
endif
...
...
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