Mercurial > hg > octave-lyh
comparison scripts/strings/base2dec.m @ 10540:952d4df5b686
Eliminate NaN*ones and Inf*ones constructs and just use Nan() and Inf()
author | Rik <code@nomad.inbox5.com> |
---|---|
date | Thu, 22 Apr 2010 14:03:47 -0700 |
parents | 1bf0ce0930be |
children | be55736a0783 |
comparison
equal
deleted
inserted
replaced
10539:8db807a0eb78 | 10540:952d4df5b686 |
---|---|
73 ## Right justify the values before anything else. | 73 ## Right justify the values before anything else. |
74 d = strjust (d, "right"); | 74 d = strjust (d, "right"); |
75 | 75 |
76 ## Lookup value of symbols in symbol table, with invalid symbols | 76 ## Lookup value of symbols in symbol table, with invalid symbols |
77 ## evaluating to NaN and space evaluating to 0. | 77 ## evaluating to NaN and space evaluating to 0. |
78 table = NaN * ones (256, 1); | 78 table = NaN (256, 1); |
79 table (toascii (symbols (1 : base))) = 0 : base-1; | 79 table (toascii (symbols (1 : base))) = 0 : base-1; |
80 table (toascii (" ")) = 0; | 80 table (toascii (" ")) = 0; |
81 d = reshape (table (toascii (d)), size (d)); | 81 d = reshape (table (toascii (d)), size (d)); |
82 | 82 |
83 ## Multiply the resulting digits by the appropriate power and | 83 ## Multiply the resulting digits by the appropriate power and |