Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #29516

Re: "ToNumber"

From Aleksandro <aleksandro@gmx.com>
Newsgroups comp.lang.javascript
Subject Re: "ToNumber"
Date 2016-02-01 11:08 -0300
Organization A noiseless patient Spider
Message-ID <n8non0$o62$1@dont-email.me> (permalink)
References <ToNumber-20160201112005@ram.dialup.fu-berlin.de> <undefined-20160201114012@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 01/02/16 07:44, Stefan Ram wrote:
> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>> < Math.floor()
>>> NaN
>> Is this specified by ECMAScript?
> 
>   In the meantime, I found this:
> 
>       »17 ECMAScript Standard Built-in Objects
> 
>       ...
> 
>       Unless otherwise specified in the description of a
>       particular function, if a built-in function or
>       constructor is given fewer arguments than the function
>       is specified to require, the function or constructor
>       shall behave exactly as if it had been given sufficient
>       additional arguments, each such argument being the
>       undefined value.«
> 
>   So, I hope that now I have found why »Math.floor()« behaves
>   like »Math.floor( undefined )«. Please let me know if you
>   think that the above quotation does /not/ apply here.

I don't see why this would not be the case, you give non-numbers to a
function that needs numbers, that's why you won't get a number either.

Back to comp.lang.javascript | Previous | Next | Find similar | Unroll thread


Thread

Re: "ToNumber" Aleksandro <aleksandro@gmx.com> - 2016-02-01 11:08 -0300

csiph-web