FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » bug in is_numeric
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: bug in is_numeric [message #181335 is a reply to message #181330] Sun, 12 May 2013 18:11 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 5/12/2013 1:38 PM, Thomas 'PointedEars' Lahn wrote:
> Thomas Mlynarczyk wrote:
>
>> Sanders Kaufman schrieb:
>>>> if(is_numeric('x11.11c') returns TRUE
>>> Try it without the quotation marks around the number.
>>
>> Which number? x11.11c is not a number.
>
> The misconception might partially draw from the fact that 0x11 is a number,
> the hexadecimal representation of decimal 16¹ + 16⁰ = 17 (even in PHP). In
> other programming languages that require a leading “0” and do not have “.”
> as (concatenation) operator,
>
> x11.11c
>
> could be the representation of decimal 16¹ + 16⁰ + 16⁻¹ + 16⁻² + 13 × 16⁻³ =
> 17.06958 (BTW, I have written a drop-in replacement for ECMAScript's
> parseFloat() that can do that, with the usual rounding errors [1]).
>
> In PHP, however,
>
> x11.11c
>
> would be equivalent to
>
> (x11) . (11c)
>

Wrong, as usual.

<snip>


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: problem encrypting data (AES_ENCRYPT/AES_DECRYPT)
Next Topic: Debian: php fast-cgi along with mod_php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 06:56:43 GMT 2024

Total time taken to generate the page: 0.05972 seconds