I currently have a Decimal that is coming through as: 4294960896 This is then converted to Binary with this function: Which equals: 11111111111111111110011100000000 I then need to take that binary and convert it to the 32bit signed version which should be ‘-6400’ I can’t seem to find any built in functions that support 32bit signed output. Answer The hexadecimal representation
Tag: decimal
Incorrect PHP calculation
Can someone give me an explanation on why this is happening in PHP: It’s probably very simple but logically I do not see any explanation. Probably how PHP works in the background. I was trying to get the first two decimal positions of a number when I ran into this case. Result should be 29 naturally. If I round the
How to convert decimal format to number format
When I convert this binary to decimal: …
PHP: get number of decimal digits
Is there a straightforward way of determining the number of decimal places in a(n) integer/double value in PHP? (that is, without using explode) Answer
Decimal validation + PHP?
How to do decimal number validation in PHP? (The decimal point is optional) it should accept … 0 , 1 , 2 , 0.123 , 0.2 , 12.34 etc. Answer Would any of these suit your needs? is_float() is_numeric()