comparison scripts/strings/dec2base.m @ 5443:ec8c33dcd1bf

[project @ 2005-09-08 01:40:57 by jwe]
author jwe
date Thu, 08 Sep 2005 01:40:58 +0000
parents 2911127d0fe7
children 2618a0750ae6
comparison
equal deleted inserted replaced
5442:636886245488 5443:ec8c33dcd1bf
59 elseif (any (n < 0 | n != fix (n))) 59 elseif (any (n < 0 | n != fix (n)))
60 error ("dec2base: can only convert non-negative integers") 60 error ("dec2base: can only convert non-negative integers")
61 endif 61 endif
62 62
63 symbols = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 63 symbols = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
64 if (isstr (base)) 64 if (ischar (base))
65 symbols = base; 65 symbols = base;
66 base = length (symbols); 66 base = length (symbols);
67 if any (diff (sort (toascii (symbols))) == 0) 67 if any (diff (sort (toascii (symbols))) == 0)
68 error ("dec2base: symbols representing digits must be unique"); 68 error ("dec2base: symbols representing digits must be unique");
69 endif 69 endif