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


Groups > comp.lang.javascript > #22550

Re: My code find negative squares buggy?

Newsgroups comp.lang.javascript
Date 2014-01-10 07:44 -0800
References <ed1316d2-3b87-4a4a-901a-05f6131e3e4f@googlegroups.com>
Message-ID <03142f1f-7c64-4fde-a992-e56ccd0e2d69@googlegroups.com> (permalink)
Subject Re: My code find negative squares buggy?
From jonas.thornvall@gmail.com

Show all headers | View raw


Den fredagen den 10:e januari 2014 kl. 16:40:49 UTC+1 skrev jonas.t...@gmail.com:
> This works fine
> 
> square=Math.sqrt(number,2);
> 
>   if(square-Math.floor(square)== 0){ctx.fillStyle = 'red';}
> 
> 
> 
> This does not?
> 
> 
> 
> negsquare=Math.sqrt(-number,2);
> 
> if(number<0 && negsquare-Math.floor(negsquare)== 0) {ctx.fillStyle = 'orange';}
> 
> 
> 
> For complete example see
> 
> file:///C:/Users/jonas/Desktop/prime0.4/main.html

Sorry
http://web.comhem.se/jonasth/prime0.4/main.html

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


Thread

My code find negative squares buggy? jonas.thornvall@gmail.com - 2014-01-10 07:40 -0800
  Re: My code find negative squares buggy? jonas.thornvall@gmail.com - 2014-01-10 07:44 -0800
  Re: My code find negative squares buggy? Tim Streater <timstreater@greenbee.net> - 2014-01-10 15:52 +0000
    Re: My code find negative squares buggy? jonas.thornvall@gmail.com - 2014-01-10 08:09 -0800
      Re: My code find negative squares buggy? Tim Streater <timstreater@greenbee.net> - 2014-01-10 16:19 +0000
        Re: My code find negative squares buggy? jonas.thornvall@gmail.com - 2014-01-10 08:32 -0800
      Re: My code find negative squares buggy? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-01-10 17:58 +0100

csiph-web