help

I need help how do i make the 0 to turn -0; thanks
25 Replies
13eck
13eckβ€’2y ago
To change the sign of a number you multiply by -1
MarkBoots
MarkBootsβ€’2y ago
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
vert_Nk26β˜‘
vert_Nk26β˜‘OPβ€’2y ago
@markboots.
MarkBoots
MarkBootsβ€’2y ago
can you give me the link of that kata? 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
vert_Nk26β˜‘
vert_Nk26β˜‘OPβ€’2y ago
ok just a sec
MarkBoots
MarkBootsβ€’2y ago
C__vanilla gave you a good tip
MarkBoots
MarkBootsβ€’2y ago
for me it works, and i can promiss you, i did nothting special for a 0 value
vert_Nk26β˜‘
vert_Nk26β˜‘OPβ€’2y ago
πŸ₯Ή beginner
MarkBoots
MarkBootsβ€’2y ago
basic maths. what do you do to make a number negative?
vert_Nk26β˜‘
vert_Nk26β˜‘OPβ€’2y ago
subtract
MarkBoots
MarkBootsβ€’2y ago
or?
vert_Nk26β˜‘
vert_Nk26β˜‘OPβ€’2y ago
replace with a negative number
MarkBoots
MarkBootsβ€’2y ago
times it by -1
13eck
13eckβ€’2y ago
Any number multiplied by -1 will give you the same number with the sign flipped
MarkBoots
MarkBootsβ€’2y ago
i was trying to exaplin it in steps 2 * -1 = -2 -2 * -1 = 2
vert_Nk26β˜‘
vert_Nk26β˜‘OPβ€’2y ago
oh man😒 oh wow
MarkBoots
MarkBootsβ€’2y ago
so every number times -1 is the opocite sign value
13eck
13eckβ€’2y ago
opposite*
vert_Nk26β˜‘
vert_Nk26β˜‘OPβ€’2y ago
almost 1hr thanks guys got it
MarkBoots
MarkBootsβ€’2y ago
yes. language. me not do πŸ˜‰ good luck man. take your time. you'll be fine
vert_Nk26β˜‘
vert_Nk26β˜‘OPβ€’2y ago
@markboots. @cvanilla13eck thanks
MarkBoots
MarkBootsβ€’2y ago
are you following a JS course. or are you just using codewars for fun?
vert_Nk26β˜‘
vert_Nk26β˜‘OPβ€’2y ago
am following a course started a month ago am using codewar to practice what I have learn @markboots.
MarkBoots
MarkBootsβ€’2y ago
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
vert_Nk26β˜‘
vert_Nk26β˜‘OPβ€’2y ago
ok thanks for the advice @markboots.
Want results from more Discord servers?
Add your server