(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

I put the following code into MATLAB:

d=(0.2+0.1)-0.2

y=(asin((d)/(0.1)))

The answer gives:

d=0.100000000000000

and i know that d/0.1 is equal to 1. so, i expect the answer of y to be

y=1.570796326794897 (which is pi/2)

but, MATLAB gives:

y= 1.570796326794897 - 0.000000021073424i

2. Relevant equations

3. The attempt at a solution

if i put:

d=0.1

then it would give:

y= 1.570796326794897

But, i want to know why the answer is complex valued when it uses 0.1000000000000000 ?

Thank you in advance.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Unexpected matlab answer

**Physics Forums | Science Articles, Homework Help, Discussion**