DIGIT-ARC read-only archive · snapshot: July 23, 2026

multiplication of floating number in php

2 posts · originally from https://geek.digit.in/community/threads/multiplication-of-floating-number-in-php.90573/

Sridhar_Rao
Sridhar_Rao Original post #1
Jun 15, 2008 at 4:14 PM
Multiplication of floating numbers in php is giving unacceptable result. For example, multiplication of 0.023* 0.0034 * 0.11 is yielding 0.
I have an array containing 48 floating numbers less than 1. I want the product of all 48 numbers, any way to achieve this in PHP?
victor_rambo
Jun 15, 2008 at 5:02 PM
*in2.php.net/manual/en/language.types.integer.php#language.types.integer.casting

As for a wordaround, since you are multiplyting, I will suggest that you multiple all numbers with powers of ten first and then again divide the output accordingly!