multiplication of floating number in php

Status
Not open for further replies.

Sridhar_Rao

In the zone
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

हॉर्न ओके प्लीज़
*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!
 
Last edited:
Status
Not open for further replies.
Top Bottom