0

I have a fairly complicated script that uses randomly generated numbers. Every so often, "-0" will be the answer to some kind of division problem. Most recently, it was 0 ÷ -198 = -0.

When I try to recreate that and echo the answer, it comes out as just 0 (as it should). My script doesn't always do with when dividing with negative numbers, BTW. I ran it another time and 0 ÷ -27 = 0 came up.


Basically, I'm getting $b and $a from other areas in the script and then doing this...

$sol_1 = $b / $a;

and $sol_1 occasionally ends up being -0.

Any ideas about what could cause this kind of behavior?

gtilflm
  • 1,389
  • 1
  • 21
  • 51

0 Answers0