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