☰
d2jsp
Rules
Help
Forum Gold FAQ
Live Streams
Photo Gallery
Hourly Raffle
Ladder Slasher
Log In
Register
Log In
Register
Account Recovery
Resend Validation Email
d2jsp Forums
>
Off-Topic
>
General Chat
>
Homework Help
> Why Does Sin(pi) Not Return 0 In Matlab?
Add Reply
New Topic
New Poll
Views: 172
Replies: 3
Track Topic
FamilyGuyViewer
Member
Posts: 35,671
Joined: Aug 11 2008
Gold
:
2,130.00
#1
Oct 25 2014 08:33pm
it returns 1.2246e-016.
Yes I know its approximately equal to 0 but why doesnt it output 0 then?
JDota72
Member
Posts: 14,433
Joined: Oct 14 2013
Gold
:
Locked
Trader:
Scammer
#2
Oct 25 2014 08:37pm
type format short
1.2246e-016 is the computer's way of being precise, it's basically zero
This post was edited by JDota72 on Oct 25 2014 08:38pm
carteblanche
Member
Posts: 32,925
Joined: Jul 23 2006
Gold
:
3,804.50
#3
Oct 25 2014 08:38pm
because pi is approximated in matlab.
if you need an exact answer, use degrees.
>> cosd(90)
ans =
0
>> sind(-180)
ans =
0
FamilyGuyViewer
Member
Posts: 35,671
Joined: Aug 11 2008
Gold
:
2,130.00
#4
Oct 25 2014 08:44pm
k thanks guys
Go Back To
Homework Help
Topic List
Add Reply
New Topic
New Poll
© 2003-2026 d2jsp
Contact