flat assembler
Message board for the users of flat assembler.

Index > Heap > i


Do you think the result is correct?
yes
33%
 33%  [ 1 ]
no
66%
 66%  [ 2 ]
Total Votes : 3

Author
Thread Post new topic Reply to topic
ass0



Joined: 31 Dec 2008
Posts: 521
Location: ( . Y . )
ass0
http://www.google.com/search?hl=en&source=hp&q=sqrt((-1)(-1))&btnG=Google+Search

Do you think the result is correct? why?

_________________
Image
Nombre: Aquiles Castro.
Location2: about:robots
Post 01 Oct 2010, 01:45
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17247
Location: In your JS exploiting you and your system
revolution
ass0 wrote:
http://www.google.com/search?hl=en&source=hp&q=sqrt((-1)(-1))&btnG=Google+Search

Do you think the result is correct? why?
I presume you mean this:

http://www.google.com/search?hl=en&source=hp&q=sqrt%28%28-1%29%28-1%29%29&btnG=Google+Search

The results looks fine to me.

By definition: -1 * -1 = 1
and sqrt (1) = 1
Post 01 Oct 2010, 01:48
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Or -1:

sqrt((-1)(-1)) == sqrt(-1) sqrt(-1)
sqrt(-1) sqrt(-1) == i * i
i * i = -1
Post 01 Oct 2010, 02:19
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Post 01 Oct 2010, 02:23
View user's profile Send private message Reply with quote
ass0



Joined: 31 Dec 2008
Posts: 521
Location: ( . Y . )
ass0
In most algebra books i've read, they claim what Tyler said, but i wonder is this some kind of exception for imaginary numbers?

((-1)*(-1))^2 == (-1)^2 * (-1)^2 == 1 * 1 == 1
((-1)*(-1))^2 == (1)^2 == 1

but the second way isn't "always true" with rational exponents.

((-1)*(-1))^(1/2) == (-1)^(1/2) * (-1)^(1/2) == i * i == -1
((-1)*(-1))^(1/2) == (1)^(1/2) == 1 != -1


I'd like a sort of proof.
MHajduk where are you?!! xD

_________________
Image
Nombre: Aquiles Castro.
Location2: about:robots


Last edited by ass0 on 01 Oct 2010, 02:37; edited 1 time in total
Post 01 Oct 2010, 02:36
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17247
Location: In your JS exploiting you and your system
revolution
sqrt (1) = +-1 ;thanks for the correction

Tyler: your link is a different calculation: sqrt(-(1*1))

ass0: You made the same mistake as I did: (1)^(1/2) == +-1
Post 01 Oct 2010, 02:36
View user's profile Send private message Visit poster's website Reply with quote
ass0



Joined: 31 Dec 2008
Posts: 521
Location: ( . Y . )
ass0
Oh, OK thanks =D

_________________
Image
Nombre: Aquiles Castro.
Location2: about:robots
Post 01 Oct 2010, 02:41
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Your calculator disagrees, Google displays the equation calculated, and this is it's output: "sqrt((-1) * (-1)) = 1"

I should have thought of the +- thing. Nice catch.
Post 01 Oct 2010, 02:42
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
if signed byte:
-1=11111111

if only one bit
-1=1
Post 02 Oct 2010, 01:56
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
edfed wrote:

if only one bit
-1=1

Hehe, a signed bit.
Post 02 Oct 2010, 02:44
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
Tyler,

Didn't you encounter signed 1-bit fields in C? They have two values, -1 and 0. Wink
Post 02 Oct 2010, 07:12
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.