Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1906 | serge | 1 | #include |
2 | #include |
||
3 | |||
4 | extern float __QNANF; |
||
5 | |||
6 | float |
||
7 | sqrtf (float x) |
||
8 | { |
||
9 | if (x < 0.0F ) |
||
10 | { |
||
11 | errno = EDOM; |
||
12 | return __QNANF; |
||
13 | } |
||
14 | else |
||
15 | { |
||
16 | float res; |
||
17 | asm ("fsqrt" : "=t" (res) : "0" (x)); |
||
18 | return res; |
||
19 | } |
||
20 | } |
||
21 | |||
22 | double |
||
23 | sqrt (double x) |
||
24 | { |
||
25 | if (x < 0.0F ) |
||
26 | { |
||
27 | errno = EDOM; |
||
28 | return __QNANF; |
||
29 | } |
||
30 | else |
||
31 | { |
||
32 | double res; |
||
33 | asm ("fsqrt" : "=t" (res) : "0" (x)); |
||
34 | return res; |
||
35 | } |
||
36 | }>> |
||
37 |