Code center > Darwinbots Program Source Code
Questions on Ceil and Floor
Numsgil:
Hey, you're the one finding 'bugs', not me. If according to your tests no bugs exist, then problem solved!
Botsareus:
yea but my output is "1; 0; -1" <---------
its not: "1; 1; -1" right?
Numsgil:
Again, I don't see the problem.
Botsareus:
if a = 0 then
writest robotnumber, 0
else
writest robotnumber, sgn(a)
end if
The above code is not required because sgn does it automaticaly.
I dont know were Endy, Py, and YOU got the "1 1 -1" from...
Numsgil:
The sign of zero.
Basically anything we choose, 1, -1, or 0, are all ligitimate choices for the sign of zero.
Don't know where I got the sign on 0 as 1 from. Just figured that sgn only returns two values.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version