Question: Trying to convert some code, but for all my googling I can't figure out how to convert this bit.

```
    float fR = fHatRandom(fRadius);
    float fQ = fLineRandom(fAngularSpread ) * (rand()&1 ? 1.0 : -1.0);
    float fK = 1;

```

This bit

```
(rand()&1 ? 1.0 : -1.0); 

```

I can't figure out.

Answer: 
Either 1.0 or -1.0 with equal chance of either one

rand() generates a number witch is anded with 0x01 i.e. the first bit and depending on if you get a bit or not you get 1.0 or -1.0
You can just randomize with 50% chance, as others said.

If you want an exact translation, it would be: 

```
((new Random().Next() & 1 > 0) ? 1.0 : -1.0)

```

You have to make a boolean out of the first part of conditional expression.