~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to tests/intops.dia.ref

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
727
727
// save load
728
728
 
729
729
deff('y=INT(x)','y=uint8(x)')
 
730
Warning :redefining function: INT                     
 
731
 
730
732
 
731
733
X=round(10*rand(1,30));
732
734
 
859
861
if or(min(x,y)<>INT(min(X,Y))) then bugmes();quit;end
860
862
 
861
863
 
 
864
 
 
865
a=[0 3 7];
 
866
 
 
867
b=[1 2 7];
 
868
 
 
869
A=[0 3 7 5;
 
870
   1 2 0 2
 
871
   8 9 3 1];
 
872
 
 
873
types=['double','int32','uint32','int16','uint16','int8','uint8']
 
874
 types  =
 
875
 
 
876
!double  int32  uint32  int16  uint16  int8  uint8  !
 
877
 
 
878
 
 
879
// checking max(a,b)
 
880
 
 
881
[mx,kx]=max(a,b);
 
882
 
 
883
for t1=types
 
884
  for t2=types
 
885
    execstr('at='+t1+'(a); bt='+t2+'(b);')
 
886
    [mt,kt]=max(at,bt);
 
887
    if or(kt<>kx)|or(mx<>double(mt)) then
 
888
      disp('max('+t1+','+t2+')'),pause
 
889
    end
 
890
  end   
 
891
end
 
892
 
 
893
 
 
894
// checking min(a,b)
 
895
 
 
896
[mn,kn]=min(a,b);
 
897
 
 
898
for t1=types
 
899
  for t2=types
 
900
    execstr('at='+t1+'(a); bt='+t2+'(b);')
 
901
    [mt,kt]=min(at,bt);
 
902
    if or(kt<>kn)|or(mn<>double(mt)) then
 
903
      disp('min('+t1+','+t2+')'),pause
 
904
    end
 
905
  end   
 
906
end
 
907
 
 
908
 
 
909
// checking max(A)
 
910
 
 
911
[mx,kx]=max(A)
 
912
 kx  =
 
913
 
 
914
!   3.    2. !
 
915
 mx  =
 
916
 
 
917
    9.  
 
918
 
 
919
for t1=types
 
920
  execstr('At='+t1+'(A);')
 
921
  [mt,kt]=max(At);
 
922
  if or(kt<>kx)|or(mx<>double(mt)) then
 
923
    disp('max('+t1+')'),pause
 
924
  end
 
925
end
 
926
 
 
927
 
 
928
// checking min(A)
 
929
 
 
930
[mx,kx]=min(A)
 
931
 kx  =
 
932
 
 
933
!   1.    1. !
 
934
 mx  =
 
935
 
 
936
    0.  
 
937
 
 
938
for t1=types
 
939
  execstr('At='+t1+'(A);')
 
940
  [mt,kt]=min(At);
 
941
  if or(kt<>kx)|or(mx<>double(mt)) then
 
942
    disp('min('+t1+')'),pause
 
943
  end
 
944
end
 
945
 
 
946
 
 
947
 
 
948
// checking max(A,'r')
 
949
 
 
950
[mx,kx]=max(A,'r')
 
951
 kx  =
 
952
 
 
953
!   3.    3.    1.    1. !
 
954
 mx  =
 
955
 
 
956
!   8.    9.    7.    5. !
 
957
 
 
958
for t1=types
 
959
  execstr('At='+t1+'(A);')
 
960
  [mt,kt]=max(At,'r');
 
961
  if or(kt<>kx)|or(mx<>double(mt)) then
 
962
    disp('max('+t1+',''r'')'),pause
 
963
  end
 
964
end
 
965
 
 
966
 
 
967
// checking min(A,'r')
 
968
 
 
969
[mx,kx]=min(A,'r')
 
970
 kx  =
 
971
 
 
972
!   1.    2.    2.    3. !
 
973
 mx  =
 
974
 
 
975
!   0.    2.    0.    1. !
 
976
 
 
977
for t1=types
 
978
  execstr('At='+t1+'(A);')
 
979
  [mt,kt]=min(At,'r');
 
980
  if or(kt<>kx)|or(mx<>double(mt)) then
 
981
    disp('min('+t1+',''r'')'),pause
 
982
  end
 
983
end
 
984
 
 
985
 
 
986
// checking max(A,'c')
 
987
 
 
988
[mx,kx]=max(A,'c')
 
989
 kx  =
 
990
 
 
991
!   3. !
 
992
!   2. !
 
993
!   2. !
 
994
 mx  =
 
995
 
 
996
!   7. !
 
997
!   2. !
 
998
!   9. !
 
999
 
 
1000
for t1=types
 
1001
  execstr('At='+t1+'(A);')
 
1002
  [mt,kt]=max(At,'c');
 
1003
  if or(kt<>kx)|or(mx<>double(mt)) then
 
1004
    disp('max('+t1+',''c'')'),pause
 
1005
  end
 
1006
end
 
1007
 
 
1008
 
 
1009
// checking min(A,'c')
 
1010
 
 
1011
[mx,kx]=min(A,'c')
 
1012
 kx  =
 
1013
 
 
1014
!   1. !
 
1015
!   3. !
 
1016
!   4. !
 
1017
 mx  =
 
1018
 
 
1019
!   0. !
 
1020
!   0. !
 
1021
!   1. !
 
1022
 
 
1023
for t1=types
 
1024
  execstr('At='+t1+'(A);')
 
1025
  [mt,kt]=min(At,'c');
 
1026
  if or(kt<>kx)|or(mx<>double(mt)) then
 
1027
    disp('min('+t1+',''c'')'),pause
 
1028
  end
 
1029
end
 
1030
 
 
1031
 
 
1032
 
862
1033
//int32 int80... iconvert
863
1034