Changeset 10 for Include/basic/function.sbp
- Timestamp:
- Nov 27, 2006, 1:07:32 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/basic/function.sbp
r1 r10 59 59 Function ipow(x As Double, n As Long) As Double 60 60 Dim abs_n As Long 61 Dim r As Double61 Dim r = 1 As Double 62 62 63 63 abs_n=Abs(n) As Long 64 r=165 64 While abs_n<>0 66 If abs_n and 1 Then r = r *x65 If abs_n and 1 Then r *= x 67 66 x = x * x 68 67 abs_n >>= 1 ' abs_n \= 2 … … 275 274 276 275 Function Atn2(y As Double, x As Double) As Double 277 If x = 0 Then 278 Atn2 = Sgn(y) * _System_PI * 0.5 279 Else 280 Atn2 = Atn(y / x) 281 If x < 0 Then 282 Atn2 += CopySign(_System_PI, y) 283 End If 284 End If 276 Atn2 = Math.Atan2(y, x) 285 277 End Function 286 278 … … 410 402 End If 411 403 412 StartPos =StartPos-1404 StartPos-- 413 405 If StartPos<0 Then 414 406 'error … … 427 419 If buf1[i2]<>buf2[i3] Then Exit Do 428 420 429 i2 =i2+1430 i3 =i3+1421 i2++ 422 i3++ 431 423 Loop 432 424 If InStr Then Exit While 433 i =i+1425 i++ 434 426 Wend 435 427 End Function … … 446 438 Dim length As Long 447 439 448 StartPos =StartPos-1440 StartPos-- 449 441 If StartPos<0 Then 450 442 'error … … 596 588 If sign Then 597 589 buffer[i]=Asc("-") 598 i =i+1590 i++ 599 591 End If 600 592 … … 602 594 '指数表示(桁が大きい場合) 603 595 buffer[i]=temp[0] 604 i =i+1596 i++ 605 597 buffer[i]=Asc(".") 606 i =i+1598 i++ 607 599 memcpy(buffer+i,temp+1,14) 608 i =i+14600 i+=14 609 601 buffer[i]=Asc("e") 610 i =i+1602 i++ 611 603 wsprintf(buffer+i,"+%03d",dec-1) 612 604 … … 617 609 '指数表示(桁が小さい場合) 618 610 buffer[i]=temp[0] 619 i =i+1611 i++ 620 612 buffer[i]=Asc(".") 621 i =i+1613 i++ 622 614 memcpy(buffer+i,temp+1,14) 623 i =i+14615 i+=14 624 616 buffer[i]=Asc("e") 625 i =i+1617 i++ 626 618 wsprintf(buffer+i,"%03d",dec-1) 627 619 … … 635 627 While i2>0 636 628 buffer[i]=temp[i3] 637 i =i+1638 i3 =i3+1639 i2 =i2-1629 i++ 630 i3++ 631 i2-- 640 632 Wend 641 633 buffer[i]=Asc(".") 642 i =i+1634 i++ 643 635 Else 644 636 buffer[i]=&H30 645 i =i+1637 i++ 646 638 buffer[i]=Asc(".") 647 i =i+1639 i++ 648 640 649 641 i2=dec 650 642 While i2<0 651 643 buffer[i]=&H30 652 i =i+1653 i2 =i2+1644 i++ 645 i2++ 654 646 Wend 655 647 End If … … 658 650 While i3<15 659 651 buffer[i]=temp[i3] 660 i =i+1661 i3 =i3+1652 i++ 653 i3++ 662 654 Wend 663 655 664 656 While buffer[i-1]=&H30 665 i =i-1657 i-- 666 658 Wend 667 If buffer[i-1]=Asc(".") Then i =i-1659 If buffer[i-1]=Asc(".") Then i-- 668 660 669 661 buffer[i]=0 … … 756 748 757 749 i64data=i64data*&O10 758 i =i-1750 i-- 759 751 Wend 760 752 ElseIf TempPtr(1)=Asc("H") Then … … 776 768 i64data=1 777 769 While i>=2 778 Val =Val+i64data*TempPtr[i]779 780 i64data =i64data*&H10770 Val += i64data*TempPtr[i] 771 772 i64data *= &H10 781 773 i-- 782 774 Wend … … 810 802 i3=i-1 811 803 While i3>=0 812 Val =Val+dbl*(buf[i3]-&H30)813 814 dbl =dbl*10804 Val += dbl*(buf[i3]-&H30) 805 806 dbl *= 10 815 807 i3-- 816 808 Wend … … 863 855 Dim NowPos As Long, BeginPos As Long 864 856 865 FileNum =FileNum-1857 FileNum-- 866 858 867 859 NowPos=SetFilePointer(_System_hFile(FileNum),0,NULL,FILE_CURRENT) … … 947 939 End If 948 940 949 i =i+2950 i2 =i2+2941 i += 2 942 i2 += 2 951 943 Continue 952 944 End If … … 960 952 If dir Then dir[i2]=path[i] 961 953 962 i =i+1963 i2 =i2+1954 i++ 955 i2++ 964 956 Loop 965 957 If dir Then dir[i3]=0 966 i3 =i3+(i-i2)958 i3 += ii-i2 967 959 968 960 'ファイル名をコピー … … 977 969 End If 978 970 979 i =i+2980 i2 =i2+2971 i += 2 972 i2 += 2 981 973 Continue 982 974 End If … … 990 982 If fname Then fname[i2]=path[i] 991 983 992 i =i+1993 i2 =i2+1984 i++ 985 i2++ 994 986 Loop 995 987 If i3=-1 Then i3=i2 996 988 If fname Then fname[i3]=0 997 i3 =i3+(i-i2)989 i3 += i-i2 998 990 999 991 '拡張子名をコピー
Note:
See TracChangeset
for help on using the changeset viewer.