# strange for me ?



## darkshadow (Jul 16, 2010)

while im just take alook at stdlib (I start refreash my knowlege in  c latly) , I found this 

```
cutoff = neg ? (unsigned long)-(LONG_MIN + LONG_MAX) + LONG_MAX
```
while 
 -(LONG_MIN + LONG_MAX) +LONG_MAX = -LONG_MIN
why it is not like this 

```
cutoff = neg ? (unsigned long)-LONG_MIN
```
is there any meaning to this operation 
the version in this link seem correct
http://www.koders.com/c/fid0A9B008CA98BE77AEC5E59AFC19BECAE325AC60F.aspx
but src code in my machine for freebsd is look like the first code


----------



## expl (Jul 16, 2010)

None of the code you pasted is valid. You are missing else operator.

Did you mean:


```
cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX;
```

Meaning if "neg" flag is not zero set cutoff to -LONG_MIN if it is zero set it to LONG_MAX.
Both definitions are found in limits.h.


----------



## darkshadow (Jul 16, 2010)

*thanks*

thanks for replay im just wondering 
while this 

```
cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX;
```
equal to

```
cutoff = neg ? (unsigned long)-(LONG_MIN + LONG_MAX) + LONG_MAX : LONG_MAX;
```
why the second used in stdlib implementation in freebsd?
is 

```
-(LONG_MIN + LONG_MAX) + LONG_MAX
```
is signature or something or it related to c ? or just to make diffrent from gnu implementation any help ?


----------

