Skip to content

Commit 27b6d36

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Simplify expression and remove the possibility of div by 0
2 parents 04f9a52 + 57e7c3a commit 27b6d36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/exif/exif.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3368,7 +3368,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
33683368
have appropriate aperture information yet. */
33693369
if (ImageInfo->ApertureFNumber == 0) {
33703370
ImageInfo->ApertureFNumber
3371-
= (float)exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)*0.5);
3371+
= expf(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*logf(2.0)*0.5);
33723372
}
33733373
break;
33743374

@@ -3379,7 +3379,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
33793379
*/
33803380
if (ImageInfo->ExposureTime == 0) {
33813381
ImageInfo->ExposureTime
3382-
= (float)(1/exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)));
3382+
= expf(-exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*logf(2.0));
33833383
}
33843384
break;
33853385
case TAG_EXPOSURETIME:

0 commit comments

Comments
 (0)