Search
Get Started
KP-C
Kevin Powell - Community
β’
3y ago
vert_Nk26β
help
I need help how do i make the 0 to turn
-0
; thanks
Kevin Powell - Community
Join
A friendly place for developers to meet other devs, ask questions, get help, and just have a good time π.
36,373
Members
View on Discord
Was this page helpful?
Yes
No
1
13eck
β’
1/12/23, 7:46 PM
To change the sign of a number you multiply by
V
vert_Nk26β
I need help how do i make the 0 to turn -0; thanks
M
MarkBoots
β’
1/12/23, 7:55 PM
0 to
-0
?
. Zero normaly doesnt have a sign
. Zero is not positive or negative
, they are the same
. In the task I can not see you have to do that
V
vert_Nk26β
OP
β’
1/12/23, 8:00 PM
@markboots
.
M
MarkBoots
β’
1/12/23, 8:01 PM
can you give me the link of that kata
?
M
MarkBoots
β’
1/12/23, 8:07 PM
nvm
, i made that one before
.
for me it just work with a 0
. you
'll have to look at your code
. there is something else going on
. the 0 is not the problem
V
vert_Nk26β
OP
β’
1/12/23, 8:09 PM
ok just a sec
M
MarkBoots
β’
1/12/23, 8:10 PM
C
_
_vanilla gave you a good tip
M
MarkBoots
β’
1/12/23, 8:11 PM
for me it works
, and i can promiss you
, i did nothting special for a 0 value
V
vert_Nk26β
OP
β’
1/12/23, 8:13 PM
beginner
M
MarkBoots
β’
1/12/23, 8:13 PM
basic maths
. what do you do to make a number negative
?
V
vert_Nk26β
OP
β’
1/12/23, 8:14 PM
subtract
M
MarkBoots
β’
1/12/23, 8:14 PM
or
?
V
vert_Nk26β
OP
β’
1/12/23, 8:15 PM
replace with a negative number
M
MarkBoots
β’
1/12/23, 8:15 PM
times it by
-1
1
13eck
β’
1/12/23, 8:16 PM
Any number multiplied by
will give you the same number with the sign flipped
M
MarkBoots
β’
1/12/23, 8:16 PM
i was trying to exaplin it in steps
M
MarkBoots
β’
1/12/23, 8:16 PM
2
*
-1
=
-2
-2
*
-1
= 2
V
vert_Nk26β
OP
β’
1/12/23, 8:17 PM
oh man
oh wow
M
MarkBoots
β’
1/12/23, 8:17 PM
so every number times
-1 is the opocite sign value
1
13eck
β’
1/12/23, 8:17 PM
opposite
*
V
vert_Nk26β
OP
β’
1/12/23, 8:17 PM
almost 1hr thanks guys
V
vert_Nk26β
OP
β’
1/12/23, 8:17 PM
got
V
vert_Nk26β
OP
β’
1/12/23, 8:18 PM
it
1
13eck
opposite*
M
MarkBoots
β’
1/12/23, 8:18 PM
yes
. language
. me not do
V
vert_Nk26β
it
M
MarkBoots
β’
1/12/23, 8:18 PM
good luck man
. take your time
. you
'll be fine
V
vert_Nk26β
OP
β’
1/12/23, 8:18 PM
@markboots
.
@c
vanilla
13eck thanks
M
MarkBoots
β’
1/12/23, 8:20 PM
are you following a JS course
. or are you just using codewars for fun
?
V
vert_Nk26β
OP
β’
1/12/23, 8:22 PM
am following a course started a month ago
V
vert_Nk26β
OP
β’
1/12/23, 8:22 PM
am using codewar to practice what I have learn
@markboots
.
M
MarkBoots
β’
1/12/23, 8:24 PM
ah okay
. make sure you don
't do too much of them while you are still in a study stage
. they can get tricky if you didnt cover all the basics yet
V
vert_Nk26β
OP
β’
1/12/23, 8:26 PM
ok thanks for the advice
@markboots
.
-1
-1
-1
-1