Jump to content

-1.#IND " nan " Error


coderage

Recommended Posts

Heres the code, the $diff variable gets the output value (sometimes) -1.#IND and if i use

echo round($diff,2); it shows "nan" on screen

 

  
$sin_dlat1 = sin($dlat1);    
$sin_dlat2 = sin($dlat2);    
$cos_dlat1 = cos($dlat1);   
$cos_dlat2 = cos($dlat2);	
$cos_long_diff = cos($dlong2 - $dlong1); 
$diff = acos($sin_dlat1*$sin_dlat2 + $cos_dlat1*$cos_dlat2*$cos_long_diff);

Link to comment
https://forums.phpfreaks.com/topic/53983-1ind-nan-error/#findComment-266864
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.