flat assembler
Message board for the users of flat assembler.

 Index > Heap > i

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

Author
ass0

Joined: 31 Dec 2008
Posts: 521
Location: ( . Y . )
ass0

Do you think the result is correct? why?

_________________

Nombre: Aquiles Castro.
01 Oct 2010, 01:45
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17463
revolution
ass0 wrote:

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

The results looks fine to me.

By definition: -1 * -1 = 1
and sqrt (1) = 1
01 Oct 2010, 01:48
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
01 Oct 2010, 02:19
Tyler

Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
01 Oct 2010, 02:23
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

_________________

Nombre: Aquiles Castro.

Last edited by ass0 on 01 Oct 2010, 02:37; edited 1 time in total
01 Oct 2010, 02:36
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17463
revolution
sqrt (1) = +-1 ;thanks for the correction

ass0: You made the same mistake as I did: (1)^(1/2) == +-1
01 Oct 2010, 02:36
ass0

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

_________________

Nombre: Aquiles Castro.
01 Oct 2010, 02:41
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.
01 Oct 2010, 02:42
edfed

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

if only one bit
-1=1
02 Oct 2010, 01:56
Tyler

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

if only one bit
-1=1

Hehe, a signed bit.
02 Oct 2010, 02:44
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.
02 Oct 2010, 07:12
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsCompiler InternalsIDE DevelopmentOS ConstructionNon-x86 architecturesHigh Level LanguagesProgramming Language DesignProjects and IdeasExamples and Tutorials Other----------------FeedbackHeapTest Area

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou can attach files in this forumYou can download files in this forum