BUG: Fix possibly undefined cast of double -> long.
BUG: Fix possibly undefined cast of double -> long.

Current double to long casting in the zipf function depends on
non-standardized behavior when the double is too big to fit in a long.
This is potentially dangerous and makes the code fail with tools such as
AddressSanitizer.

Checks are added here to prevent overflow during casting and make sure
we get the desired behavior.

grlee77/numpy,endolith/numpy,pbrod/numpy,seberg/numpy,abalkin/numpy,mattip/numpy,numpy/numpy,mattip/numpy,shoyer/numpy,pbrod/numpy,jorisvandenbossche/numpy,MSeifert04/numpy,ahaldane/numpy,jakirkham/numpy,numpy/numpy,madphysicist/numpy,mhvk/numpy,WarrenWeckesser/numpy,seberg/numpy,rgommers/numpy,Eric89GXL/numpy,ahaldane/numpy,WarrenWeckesser/numpy,MSeifert04/numpy,jakirkham/numpy,numpy/numpy,endolith/numpy,simongibbons/numpy,mhvk/numpy,shoyer/numpy,MSeifert04/numpy,gfyoung/numpy,pbrod/numpy,tynn/numpy,tynn/numpy,MSeifert04/numpy,anntzer/numpy,anntzer/numpy,anntzer/numpy,tynn/numpy,jakirkham/numpy,shoyer/numpy,mattip/numpy,jorisvandenbossche/numpy,WarrenWeckesser/numpy,charris/numpy,shoyer/numpy,mhvk/numpy,madphysicist/numpy,grlee77/numpy,endolith/numpy,endolith/numpy,jakirkham/numpy,gfyoung/numpy,simongibbons/numpy,madphysicist/numpy,pizzathief/numpy,pizzathief/numpy,grlee77/numpy,pizzathief/numpy,ahaldane/numpy,simongibbons/numpy,abalkin/numpy,pizzathief/numpy,shoyer/numpy,charris/numpy,simongibbons/numpy,rgommers/numpy,WarrenWeckesser/numpy,simongibbons/numpy,jorisvandenbossche/numpy,seberg/numpy,Eric89GXL/numpy,grlee77/numpy,madphysicist/numpy,abalkin/numpy,pdebuyl/numpy,grlee77/numpy,pdebuyl/numpy,Eric89GXL/numpy,rgommers/numpy,mattip/numpy,WarrenWeckesser/numpy,pbrod/numpy,charris/numpy,gfyoung/numpy,pizzathief/numpy,ahaldane/numpy,jorisvandenbossche/numpy,numpy/numpy,jorisvandenbossche/numpy,ahaldane/numpy,jakirkham/numpy,madphysicist/numpy,MSeifert04/numpy,charris/numpy,mhvk/numpy,mhvk/numpy,Eric89GXL/numpy,rgommers/numpy,pdebuyl/numpy,pdebuyl/numpy,pbrod/numpy,seberg/numpy,anntzer/numpy